Added safety checks

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8626 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2018-09-30 19:40:55 +00:00
parent 8c6f69fbb8
commit 50d7b679c1
5 changed files with 498 additions and 104 deletions
+21
View File
@@ -8957,6 +8957,27 @@ void DoInteractiveActionDefaultResult( INT32 sGridNo, UINT8 ubID, BOOLEAN aSucce
aSuccess = TRUE;
}
}
else
{
aSuccess = FALSE;
// not enough money for a soda, hu? Too bad for you Flugente played the old Crusader Games, which teach you how to handle that particular issue!
ScreenMsg( FONT_MCOLOR_RED, MSG_INTERFACE, L"The World Economic Consortium does not condone moochers!" );
INT16 direction = GetDirectionToGridNoFromGridNo( sGridNo, pSoldier->sGridNo );
INT32 startgridno = NewGridNo( sGridNo, DirectionInc(direction) );
INT32 targetgridno = NewGridNo( startgridno, DirectionInc( direction ) );
FLOAT x, y, z;
GetTargetWorldPositions( NULL, targetgridno, &x, &y, &z );
// fire at torso height
z += 100.0f;
// fire a AP rocket with damage 40. The ammotype currently gets rerolled to Ball, but it's not like anyone will complain
FireBulletGivenTarget_NoObjectNoSoldier( 55, 2, 40, startgridno, z, x, y, z, 0 );
}
}
}
}