From 5ff0abe5681a519f05c1339c6d01e3e970178a81 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Aug 2016 19:10:14 +0200 Subject: [PATCH] - removed STAT_INVENTORY. This was causing issues with sprite sorting. For this to work as intended, all actors in the world that display sprites need to remain in spawn order, including inventory items. The only thing this statnum was used for were some bot related search actions which are simply not worth breaking actual maps for some very minor performance gain. --- src/b_think.cpp | 2 +- src/g_level.cpp | 2 +- src/g_shared/a_pickups.cpp | 1 - src/statnums.h | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/b_think.cpp b/src/b_think.cpp index 0ff75722a9..5a98b5c1ae 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -259,7 +259,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd) r = pr_botmove(); if (r < 128) { - TThinkerIterator it (STAT_INVENTORY, bglobal.firstthing); + TThinkerIterator it (MAX_STATNUM+1, bglobal.firstthing); AInventory *item = it.Next(); if (item != NULL || (item = it.Next()) != NULL) diff --git a/src/g_level.cpp b/src/g_level.cpp index e47cbb4a55..349d8f5a6e 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1280,7 +1280,7 @@ void G_FinishTravel () for (inv = pawn->Inventory; inv != NULL; inv = inv->Inventory) { - inv->ChangeStatNum (STAT_INVENTORY); + inv->ChangeStatNum (STAT_DEFAULT); inv->LinkToWorld (); inv->Travelled (); } diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 6ad8e6e4a7..e41a91d2f9 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -572,7 +572,6 @@ bool AInventory::ShouldRespawn () void AInventory::BeginPlay () { Super::BeginPlay (); - ChangeStatNum (STAT_INVENTORY); flags |= MF_DROPPED; // [RH] Items are dropped by default } diff --git a/src/statnums.h b/src/statnums.h index 7f691e232a..45bb53e654 100644 --- a/src/statnums.h +++ b/src/statnums.h @@ -53,7 +53,7 @@ enum STAT_BOSSTARGET, // A boss brain target STAT_LIGHTNING, // The lightning thinker STAT_DECALTHINKER, // An object that thinks for a decal - STAT_INVENTORY, // An inventory item + UNUSED_STAT_INVENTORY, // An inventory item (value kept for savegame compatibility.) STAT_LIGHT, // A sector light effect STAT_LIGHTTRANSFER, // A sector light transfer. These must be ticked after the light effects!!! STAT_EARTHQUAKE, // Earthquake actors