From ad59900b3df96ec25cb2c35327f5461bb355d48e Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 4 Jul 2020 14:47:40 +0000 Subject: [PATCH] Fix: individual militia in impassable sectors cannot be dismissed via website git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8837 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/MilitiaInterface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Laptop/MilitiaInterface.cpp b/Laptop/MilitiaInterface.cpp index 648f6365..808d5b87 100644 --- a/Laptop/MilitiaInterface.cpp +++ b/Laptop/MilitiaInterface.cpp @@ -319,8 +319,10 @@ MilitiaPersonalDataTable::Display( ) // if we can still fire this guy, set up the button if ( !(militia.flagmask & (MILITIAFLAG_DEAD | MILITIAFLAG_FIRED | MILITIAFLAG_DESERTION )) ) { - // we can't fire someone if they are in combat - if ( SectorOursAndPeaceful( SECTORX( militia.sector ), SECTORY( militia.sector ), 0 ) ) + // we can only fire someone in sectors we control that are not in combat + // if we've managed to misplace a militia into an impassable sector (HOW???), we can at least fire them, too + if ( SectorOursAndPeaceful( SECTORX( militia.sector ), SECTORY( militia.sector ), 0 ) + || SectorIsImpassable( militia.sector ) ) { mButtonFire = CreateTextButton( szIdividualMilitiaWebsiteText[8], FONT12ARIAL, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, usPosX, usPosY, 120, 20, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, MilitiaPersonalDataTableFireCallback );