Fix a bug in recvDestroyStructure due to use of the un-safe function destroyStruct

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3194 4a71c877-e1ca-e34f-864e-861f7616d084
master
Freddie Witherden 2007-12-27 15:14:26 +00:00
parent f7e7e44329
commit 28a1b3e2b3
1 changed files with 14 additions and 15 deletions

View File

@ -330,23 +330,22 @@ BOOL recvDestroyStructure()
STRUCTURE *psStruct; STRUCTURE *psStruct;
NETbeginDecode(); NETbeginDecode();
NETuint32_t(&structID); NETuint32_t(&structID);
// Struct to destory
psStruct = IdToStruct(structID,ANYPLAYER);
if (psStruct)
{
turnOffMultiMsg(TRUE);
// Remove the struct from remote players machine
destroyStruct(psStruct);
turnOffMultiMsg(FALSE);
// NOTE: I do not think this should be here!
technologyGiveAway(psStruct);
}
NETend(); NETend();
// Struct to destory
psStruct = IdToStruct(structID,ANYPLAYER);
if (psStruct)
{
turnOffMultiMsg(TRUE);
// Remove the struct from remote players machine
destroyStruct(psStruct);
turnOffMultiMsg(FALSE);
// NOTE: I do not think this should be here!
technologyGiveAway(psStruct);
}
return TRUE; return TRUE;
} }