Fix build break from 30f9233
Commit30f9233b36
introduced a test for Game_Mode, which does not exist, rather than Game_mode, which does exist. However, the test for game mode is unnecessary. Objects of type OBJ_NONE are always in segment_none and no object of any other type should be in segment_none. Use that fact to test obj->type instead of obj->segnum during multiplayer object clobber, so that multiplayer can overwrite unallocated objects without accessing any undefined fields and without making object::segnum a defined field. Fixes:30f9233b36
("Reverted2e6aa0f081
and partially reverted7064fcccba
to still allow segnum and signature init for multiplayer games, keeping consistency during object sync.")
This commit is contained in:
parent
e231fb7d3a
commit
7ccd537362
|
@ -2047,7 +2047,7 @@ static void net_udp_read_object_packet( ubyte *data )
|
|||
}
|
||||
if (objnum != object_none) {
|
||||
auto obj = vobjptridx(objnum);
|
||||
if (obj->segnum != segment_none)
|
||||
if (obj->type != OBJ_NONE)
|
||||
{
|
||||
obj_unlink(obj);
|
||||
Assert(obj->segnum == segment_none);
|
||||
|
|
|
@ -828,12 +828,6 @@ void init_objects()
|
|||
free_obj_list[i] = i;
|
||||
const auto &&objp = vobjptr(i);
|
||||
objp->type = OBJ_NONE;
|
||||
// init segment and signature for multiplayer object sync.
|
||||
if (Game_Mode & GM_MULTI)
|
||||
{
|
||||
objp->segnum = segment_none;
|
||||
objp->signature = obj_get_signature();
|
||||
}
|
||||
}
|
||||
|
||||
range_for (auto &j, Segments)
|
||||
|
|
Loading…
Reference in a new issue