From 12ad7ee933163516c8382e05b5608f40b92ef6ed Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 2 Sep 2017 07:57:03 +0200 Subject: [PATCH] Do not call DoEffect when predicting player movement. --- src/p_mobj.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 74f7683d1b..561334a52d 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4113,18 +4113,22 @@ void AActor::Tick () } else { - AInventory * item = Inventory; - // Handle powerup effects here so that the order is controlled - // by the order in the inventory, not the order in the thinker table - while (item != NULL && item->Owner == this) + if (!player || !(player->cheats & CF_PREDICTING)) { - IFVIRTUALPTR(item, AInventory, DoEffect) + // Handle powerup effects here so that the order is controlled + // by the order in the inventory, not the order in the thinker table + AInventory *item = Inventory; + + while (item != NULL && item->Owner == this) { - VMValue params[1] = { item }; - VMCall(func, params, 1, nullptr, 0); + IFVIRTUALPTR(item, AInventory, DoEffect) + { + VMValue params[1] = { item }; + VMCall(func, params, 1, nullptr, 0); + } + item = item->Inventory; } - item = item->Inventory; } if (flags & MF_UNMORPHED)