From 7384ae7268a00bcb7c4959171547fff884b83395 Mon Sep 17 00:00:00 2001 From: Overhaul Date: Sat, 14 Jul 2007 08:09:59 +0000 Subject: [PATCH] Newly placed tanks now drag away old wreckage if present Console line input only backspaces to beginning of line git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1050 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Console/Console.cpp | 21 ++++++++------------- Tactical/Soldier Init List.cpp | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Console/Console.cpp b/Console/Console.cpp index a66b50fe..20cbc2b9 100644 --- a/Console/Console.cpp +++ b/Console/Console.cpp @@ -917,26 +917,21 @@ void Console::OnChar(WORD myChar) { if (myChar == 8) { - if (Input.length() > 0) + int l = Input.length(); + if (l > 0) { - wchar_t last = Input[ Input.length() - 1]; + wchar_t last = Input[ l - 1]; + if (last == '\n') + { + return; + } text[0] = 8; text[1] = L' '; text[2] = 8; text[3] = 0; - Input.resize( Input.length() - 1); - - if (last == '\n') - { - int cx = Input.rfind( '\n') + 1; - cx = Input.length() - cx; - SendTextToConsole( text); - m_csbiCursor.dwCursorPosition.X = cx; - - return; - } + Input.resize( l - 1); } else { diff --git a/Tactical/Soldier Init List.cpp b/Tactical/Soldier Init List.cpp index 324586ec..4296068c 100644 --- a/Tactical/Soldier Init List.cpp +++ b/Tactical/Soldier Init List.cpp @@ -45,6 +45,7 @@ #include "MessageBoxScreen.h" #include "screenids.h" #include "SaveLoadScreen.h" + #include "Rotting Corpses.h" #endif #include "Map Edgepoints.h" @@ -537,6 +538,24 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr ) //memset( &tempDetailedPlacement, 0, SIZEOF_SOLDIERCREATE_STRUCT ); tempDetailedPlacement.initialize(); + if (curr->pBasicPlacement->bBodyType == TANK_NW || + curr->pBasicPlacement->bBodyType == TANK_NE) + { + while (1) + { + ROTTING_CORPSE *pCorpse = GetCorpseAtGridNo( curr->pBasicPlacement->usStartingGridNo, 0); // I assume we don't find tanks on the roof + if (pCorpse) + { + // Assume this is a dead tank and have the replacement tank haul it away + RemoveCorpse( pCorpse->iID); + } + else + { + break; + } + } + } + DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddPlacementToWorld: decide on placement")); if( curr->pDetailedPlacement ) {