Fix crash in message code when using cheat menu to switch between players. It happened because we would

always search and remove messages for selectedPlayer, even though each player has its own message queue.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9132 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-01-11 16:40:19 +00:00 committed by Git SVN Gateway
parent baa0ac2188
commit 58425f4144
1 changed files with 4 additions and 5 deletions

View File

@ -525,17 +525,16 @@ bool removeFeature(FEATURE *psDel)
intRefreshScreen();
}
if ( (psDel->psStats->subType == FEAT_GEN_ARTE)
||(psDel->psStats->subType == FEAT_OIL_RESOURCE))
if (psDel->psStats->subType == FEAT_GEN_ARTE || psDel->psStats->subType == FEAT_OIL_RESOURCE)
{
// have to check all players cos if you cheat you'll get em.
for (player=0; player<MAX_PLAYERS; player ++)
for (player = 0; player < MAX_PLAYERS; player++)
{
//see if there is a proximity message FOR THE SELECTED PLAYER at this location
psMessage = findMessage((MSG_VIEWDATA *)psDel, MSG_PROXIMITY, selectedPlayer);
psMessage = findMessage((MSG_VIEWDATA *)psDel, MSG_PROXIMITY, player);
while (psMessage)
{
removeMessage(psMessage, selectedPlayer);
removeMessage(psMessage, player);
psMessage = findMessage((MSG_VIEWDATA *)psDel, MSG_PROXIMITY, player);
}
}