diff --git a/src/playsim/dthinker.cpp b/src/playsim/dthinker.cpp index 05e5e56c3d..2d37ffcfd5 100644 --- a/src/playsim/dthinker.cpp +++ b/src/playsim/dthinker.cpp @@ -415,12 +415,12 @@ void FThinkerCollection::SerializeThinkers(FSerializer &arc, bool hubLoad) else if (thinker->ObjectFlags & OF_JustSpawned) { FreshThinkers[i].AddTail(thinker); - thinker->PostSerialize(); + thinker->CallPostSerialize(); } else { Thinkers[i].AddTail(thinker); - thinker->PostSerialize(); + thinker->CallPostSerialize(); } } } @@ -833,6 +833,16 @@ void DThinker::PostSerialize() { } +void DThinker::CallPostSerialize() +{ + PostSerialize(); + IFOVERRIDENVIRTUALPTRNAME(this, NAME_Thinker, OnLoad) + { + VMValue params[] = { this }; + VMCall(func, params, 1, nullptr, 0); + } +} + //========================================================================== // // diff --git a/src/playsim/dthinker.h b/src/playsim/dthinker.h index ab4a453b88..95c2bb4bc8 100644 --- a/src/playsim/dthinker.h +++ b/src/playsim/dthinker.h @@ -105,6 +105,7 @@ public: virtual void PostBeginPlay (); // Called just before the first tick virtual void CallPostBeginPlay(); // different in actor. virtual void PostSerialize(); + void CallPostSerialize(); void Serialize(FSerializer &arc) override; size_t PropagateMark(); diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 4d18899f53..161230a25f 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -242,7 +242,6 @@ void AActor::Serialize(FSerializer &arc) A("angles", Angles) A("frame", frame) A("scale", Scale) - A("nolocalrender", NoLocalRender) // Note: This will probably be removed later since a better solution is needed A("renderstyle", RenderStyle) A("renderflags", renderflags) A("renderflags2", renderflags2) diff --git a/wadsrc/static/zscript/actors/inventory/inventory.zs b/wadsrc/static/zscript/actors/inventory/inventory.zs index 607c4f7c4e..40a89cb084 100644 --- a/wadsrc/static/zscript/actors/inventory/inventory.zs +++ b/wadsrc/static/zscript/actors/inventory/inventory.zs @@ -85,6 +85,11 @@ class Inventory : Actor Inventory.PickupSound "misc/i_pkup"; Inventory.PickupMessage "$TXT_DEFAULTPICKUPMSG"; } + + override void OnLoad() + { + UpdateLocalPickupStatus(); + } //native override void Tick(); @@ -1113,6 +1118,11 @@ class Inventory : Actor return pickedUp[client.PlayerNumber()]; } + void UpdateLocalPickupStatus() + { + DisableLocalRendering(consoleplayer, pickedUp[consoleplayer]); + } + // When items are dropped, clear their local pick ups. void ClearLocalPickUps() { diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 7cd4d3be48..ffebf625fc 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -238,6 +238,7 @@ class Thinker : Object native play virtual native void Tick(); virtual native void PostBeginPlay(); + virtual void OnLoad() {} native void ChangeStatNum(int stat); static clearscope int Tics2Seconds(int tics)