improved the way how marbles works, now it will work already when reaching the gridno where marbles are, not just when trying to exit it

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9036 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Shadooow
2021-05-21 18:46:29 +00:00
parent 5d81b61f8e
commit 9a942fcb89
+20
View File
@@ -2884,6 +2884,26 @@ BOOLEAN HandleAtNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving )
return( FALSE );
}
if (pSoldier->pathing.bLevel == 0 && pSoldier->aiData.ubPendingAction != MERC_PICKUPITEM && (pSoldier->bOverTerrainType == FLAT_FLOOR || pSoldier->bOverTerrainType == PAVED_ROAD))
{
INT32 iMarblesIndex;
if (MarblesExistAtLocation(pSoldier->sGridNo, 0, &iMarblesIndex))
{
// Slip on marbles!
pSoldier->DoMercBattleSound(BATTLE_SOUND_CURSE1);
if (pSoldier->bTeam == gbPlayerNum)
{
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, Message[STR_SLIPPED_MARBLES], pSoldier->name);
}
RemoveItemFromPool(pSoldier->sGridNo, iMarblesIndex, 0);
SoldierCollapse(pSoldier);
if (pSoldier->bActionPoints > 0)
{
pSoldier->bActionPoints -= (INT8)(Random(pSoldier->bActionPoints) + 1);
}
return(FALSE);
}
}
// Set "interrupt occurred" flag to false so that we will know whether *this
// particular call* to HandleSight caused an interrupt