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-861f7616d084master
parent
baa0ac2188
commit
58425f4144
|
@ -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++)
|
||||
{
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue