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-861f7616d084master
parent
f7e7e44329
commit
28a1b3e2b3
|
@ -330,23 +330,22 @@ BOOL recvDestroyStructure()
|
|||
STRUCTURE *psStruct;
|
||||
|
||||
NETbeginDecode();
|
||||
|
||||
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();
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue