diff --git a/src/am_map.cpp b/src/am_map.cpp index 305748317..07bd49b75 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -2966,7 +2966,6 @@ void AM_drawKeys () // Find the key's own color. // Only works correctly if single-key locks have lower numbers than any-key locks. // That is the case for all default keys, however. - int P_GetMapColorForKey (AInventory * key); int c = P_GetMapColorForKey(key); if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c)); @@ -3066,8 +3065,7 @@ void AM_drawThings () } else if (am_showkeys) { - int P_GetMapColorForKey (AInventory * key); - int c = P_GetMapColorForKey(static_cast(t)); + int c = P_GetMapColorForKey(t); if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c)); else color = AMColors[AMColors.ThingColor_CountItem]; diff --git a/src/b_bot.h b/src/b_bot.h index f2cfdee81..393650cf4 100644 --- a/src/b_bot.h +++ b/src/b_bot.h @@ -99,7 +99,7 @@ using BotInfoMap = TMap; extern BotInfoMap BotInfo; -inline BotInfoData GetBotInfo(AInventory *weap) +inline BotInfoData GetBotInfo(AActor *weap) { if (weap == nullptr) return BotInfoData(); auto k = BotInfo.CheckKey(weap->GetClass()->TypeName); @@ -145,7 +145,7 @@ public: botinfo_t *botinfo; int spawn_tries; int wanted_botnum; - TObjPtr firstthing; + TObjPtr firstthing; TObjPtr body1; TObjPtr body2; diff --git a/src/d_net.cpp b/src/d_net.cpp index d271bc472..87ee3d7ed 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2249,11 +2249,11 @@ void Net_DoCommand (int type, uint8_t **stream, int player) case DEM_INVUSEALL: if (gamestate == GS_LEVEL && !paused) { - auto item = players[player].mo->Inventory; + AActor *item = players[player].mo->Inventory; auto pitype = PClass::FindActor(NAME_PuzzleItem); - while (item != NULL) + while (item != nullptr) { - auto next = item->Inventory; + AActor *next = item->Inventory; IFVIRTUALPTR(item, AInventory, UseAll) { VMValue param[] = { item, players[player].mo }; diff --git a/src/d_player.h b/src/d_player.h index 203e444d0..1e05d4076 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -94,8 +94,7 @@ public: bool ResetAirSupply (bool playgasp = true); int GetMaxHealth(bool withupgrades = false) const; - AInventory *PickNewWeapon (PClassActor *ammotype); - AInventory *BestWeapon (PClassActor *ammotype); + AActor *PickNewWeapon (PClassActor *ammotype); void GiveDeathmatchInventory (); void GiveDefaultInventory (); @@ -124,8 +123,8 @@ public: int RunHealth; int PlayerFlags; double FullHeight; - TObjPtr InvFirst; // first inventory item displayed on inventory bar - TObjPtr InvSel; // selected inventory item + TObjPtr InvFirst; // first inventory item displayed on inventory bar + TObjPtr InvSel; // selected inventory item // [GRB] Player class properties double JumpZ; diff --git a/src/dobject.h b/src/dobject.h index 81e44d80a..44ffa61fb 100644 --- a/src/dobject.h +++ b/src/dobject.h @@ -377,8 +377,6 @@ T* Create(Args&&... args) } -class AInventory;// - // When you write to a pointer to an Object, you must call this for // proper bookkeeping in case the Object holding this pointer has // already been processed by the GC. diff --git a/src/g_game.cpp b/src/g_game.cpp index 33957673f..e8bee23a1 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -216,7 +216,7 @@ FString savename; FString BackupSaveName; bool SendLand; -const AInventory *SendItemUse, *SendItemDrop; +const AActor *SendItemUse, *SendItemDrop; int SendItemDropAmount; EXTERN_CVAR (Int, team) @@ -414,7 +414,7 @@ CCMD(invprev) CCMD (invuseall) { - SendItemUse = (const AInventory *)1; + SendItemUse = (const AActor *)1; } CCMD (invuse) @@ -428,7 +428,7 @@ CCMD (invuse) CCMD(invquery) { - AInventory *inv = players[consoleplayer].mo->InvSel; + AActor *inv = players[consoleplayer].mo->InvSel; if (inv != NULL) { Printf(PRINT_HIGH, "%s (%dx)\n", inv->GetTag(), inv->IntVar(NAME_Amount)); @@ -735,7 +735,7 @@ void G_BuildTiccmd (ticcmd_t *cmd) Net_WriteString (savedescription); savegamefile = ""; } - if (SendItemUse == (const AInventory *)1) + if (SendItemUse == (const AActor *)1) { Net_WriteByte (DEM_INVUSEALL); SendItemUse = NULL; @@ -2898,4 +2898,4 @@ DEFINE_GLOBAL(gametic) DEFINE_GLOBAL(demoplayback) DEFINE_GLOBAL(automapactive); DEFINE_GLOBAL(Net_Arbitrator); -DEFINE_GLOBAL(netgame); \ No newline at end of file +DEFINE_GLOBAL(netgame); diff --git a/src/g_game.h b/src/g_game.h index 6f5f93261..21329e78e 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -32,6 +32,9 @@ struct event_t; #include "dobjgc.h" + +class AActor; + // // GAME // @@ -96,7 +99,7 @@ void G_AddViewPitch (int look, bool mouse = false); void G_AddViewAngle (int yaw, bool mouse = false); class AInventory; -extern const AInventory *SendItemUse, *SendItemDrop; +extern const AActor *SendItemUse, *SendItemDrop; extern int SendItemDropAmount; const int SAVEPICWIDTH = 216; diff --git a/src/g_inventory/a_keys.cpp b/src/g_inventory/a_keys.cpp index 568c7b386..dd5660d0d 100644 --- a/src/g_inventory/a_keys.cpp +++ b/src/g_inventory/a_keys.cpp @@ -63,9 +63,7 @@ struct OneKey if (owner->IsA(key) || owner->GetSpecies() == key->TypeName) return true; // Other calls check an actor that may have a key in its inventory. - AInventory *item; - - for (item = owner->Inventory; item != NULL; item = item->Inventory) + for (AActor *item = owner->Inventory; item != NULL; item = item->Inventory) { if (item->IsA(key)) { @@ -129,7 +127,7 @@ struct Lock if (!keylist.Size()) { auto kt = PClass::FindActor(NAME_Key); - for (AInventory * item = owner->Inventory; item != NULL; item = item->Inventory) + for (AActor *item = owner->Inventory; item != NULL; item = item->Inventory) { if (item->IsKindOf (kt)) { @@ -430,9 +428,9 @@ static void CreateSortedKeyList() if (ti->IsDescendantOf(kt)) { - AInventory *key = (AInventory*)(GetDefaultByType(ti)); + auto key = GetDefaultByType(ti); - if (key->Icon.isValid() && key->special1 > 0) + if (key->special1 > 0) { KeyTypes.Push(ti); } @@ -587,7 +585,7 @@ int P_GetMapColorForLock (int lock) // //========================================================================== -int P_GetMapColorForKey (AInventory * key) +int P_GetMapColorForKey (AActor * key) { int i; diff --git a/src/g_inventory/a_keys.h b/src/g_inventory/a_keys.h index 14f6625a5..dc95e17bb 100644 --- a/src/g_inventory/a_keys.h +++ b/src/g_inventory/a_keys.h @@ -2,14 +2,13 @@ #define A_KEYS_H class AActor; -class AInventory; class PClassActor; int P_CheckKeys (AActor *owner, int keynum, bool remote, bool quiet = false); void P_InitKeyMessages (); void P_DeinitKeyMessages (); int P_GetMapColorForLock (int lock); -int P_GetMapColorForKey (AInventory *key); +int P_GetMapColorForKey (AActor *key); int P_GetKeyTypeCount(); PClassActor *P_GetKeyType(int num); diff --git a/src/g_inventory/a_pickups.cpp b/src/g_inventory/a_pickups.cpp index d91f1e766..10c2cfdb7 100644 --- a/src/g_inventory/a_pickups.cpp +++ b/src/g_inventory/a_pickups.cpp @@ -132,9 +132,9 @@ DEFINE_ACTION_FUNCTION(AInventory, PrintPickupMessage) // //=========================================================================== -void DepleteOrDestroy (AInventory *item) +void DepleteOrDestroy (AActor *item) { - IFVIRTUALPTR(item, AInventory, DepleteOrDestroy) + IFVIRTUALPTRNAME(item, NAME_Inventory, DepleteOrDestroy) { VMValue params[1] = { item }; VMCall(func, params, 1, nullptr, 0); @@ -147,7 +147,7 @@ void DepleteOrDestroy (AInventory *item) // //=========================================================================== -bool CallTryPickup(AInventory *item, AActor *toucher, AActor **toucher_return) +bool CallTryPickup(AActor *item, AActor *toucher, AActor **toucher_return) { static VMFunction *func = nullptr; if (func == nullptr) PClass::FindFunction(&func, NAME_Inventory, NAME_CallTryPickup); diff --git a/src/g_inventory/a_pickups.h b/src/g_inventory/a_pickups.h index b0469f356..adf493d8d 100644 --- a/src/g_inventory/a_pickups.h +++ b/src/g_inventory/a_pickups.h @@ -89,7 +89,7 @@ public: FSoundIDNoInit PickupSound; }; -bool CallTryPickup(AInventory *item, AActor *toucher, AActor **toucher_return = nullptr); -void DepleteOrDestroy(AInventory *item); // virtual on the script side. +bool CallTryPickup(AActor *item, AActor *toucher, AActor **toucher_return = nullptr); +void DepleteOrDestroy(AActor *item); // virtual on the script side. #endif //__A_PICKUPS_H__ diff --git a/src/g_inventory/a_weapons.cpp b/src/g_inventory/a_weapons.cpp index 0e2f1b6ab..6de49d09c 100644 --- a/src/g_inventory/a_weapons.cpp +++ b/src/g_inventory/a_weapons.cpp @@ -351,7 +351,7 @@ void FWeaponSlots::AddExtraWeapons() { continue; } - auto weapdef = ((AInventory*)GetDefaultByType(cls)); + auto weapdef = GetDefaultByType(cls); // Let the weapon decide for itself if it wants to get added to a slot. IFVIRTUALPTRNAME(weapdef, NAME_Weapon, CheckAddToSlots) diff --git a/src/g_level.cpp b/src/g_level.cpp index b29ddd072..dca97f219 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1282,7 +1282,7 @@ void G_StartTravel () if (playeringame[i]) { AActor *pawn = players[i].mo; - AInventory *inv; + AActor *inv; players[i].camera = NULL; // Only living players travel. Dead ones get a new body on the new level. @@ -1321,7 +1321,7 @@ int G_FinishTravel () { TThinkerIterator it (STAT_TRAVELLING); APlayerPawn *pawn, *pawndup, *oldpawn, *next; - AInventory *inv; + AActor *inv; FPlayerStart *start; int pnum; int failnum = 0; @@ -1409,7 +1409,7 @@ int G_FinishTravel () inv->ChangeStatNum (STAT_INVENTORY); inv->LinkToWorld (nullptr); - IFVIRTUALPTR(inv, AInventory, Travelled) + IFVIRTUALPTRNAME(inv, NAME_Inventory, Travelled) { VMValue params[1] = { inv }; VMCall(func, params, 1, nullptr, 0); diff --git a/src/g_statusbar/sbar.h b/src/g_statusbar/sbar.h index a7a1e0960..c198f1b94 100644 --- a/src/g_statusbar/sbar.h +++ b/src/g_statusbar/sbar.h @@ -460,7 +460,7 @@ private: public: - AInventory *ValidateInvFirst (int numVisible) const; + AActor *ValidateInvFirst (int numVisible) const; void DrawCrosshair (); // Sizing info for ths status bar. @@ -522,8 +522,7 @@ void ST_Clear(); void ST_CreateStatusBar(bool bTitleLevel); extern FTexture *CrosshairImage; -//FTextureID GetInventoryIcon(AInventory *item, uint32_t flags, int *applyscale = nullptr); -int GetInventoryIcon(AInventory *item, uint32_t flags, int *applyscale = nullptr); +int GetInventoryIcon(AActor *item, uint32_t flags, int *applyscale = nullptr); enum DI_Flags diff --git a/src/g_statusbar/sbarinfo_commands.cpp b/src/g_statusbar/sbarinfo_commands.cpp index 22624542e..2b353ebe3 100644 --- a/src/g_statusbar/sbarinfo_commands.cpp +++ b/src/g_statusbar/sbarinfo_commands.cpp @@ -619,7 +619,7 @@ class CommandDrawSwitchableImage : public CommandDrawImage } else //check the inventory items and draw selected sprite { - AInventory* item = statusBar->CPlayer->mo->FindInventory(inventoryItem[0]); + auto item = statusBar->CPlayer->mo->FindInventory(inventoryItem[0]); if(item == NULL || !EvaluateOperation(conditionalOperator[0], conditionalValue[0], item->IntVar(NAME_Amount))) drawAlt = 1; if(conditionAnd) @@ -1351,7 +1351,7 @@ class CommandDrawNumber : public CommandDrawString break; case AMMO: { - AInventory* item = statusBar->CPlayer->mo->FindInventory(inventoryItem); + auto item = statusBar->CPlayer->mo->FindInventory(inventoryItem); if(item != NULL) num = item->IntVar(NAME_Amount); else @@ -1378,11 +1378,11 @@ class CommandDrawNumber : public CommandDrawString break; case AMMOCAPACITY: { - AInventory* item = statusBar->CPlayer->mo->FindInventory(inventoryItem); + auto item = statusBar->CPlayer->mo->FindInventory(inventoryItem); if(item != NULL) num = item->IntVar(NAME_MaxAmount); else - num = ((AInventory *)GetDefaultByType(inventoryItem))->IntVar(NAME_MaxAmount); + num = GetDefaultByType(inventoryItem)->IntVar(NAME_MaxAmount); break; } case FRAGS: @@ -1449,7 +1449,7 @@ class CommandDrawNumber : public CommandDrawString } case INVENTORY: { - AInventory* item = statusBar->CPlayer->mo->FindInventory(inventoryItem); + auto item = statusBar->CPlayer->mo->FindInventory(inventoryItem); if(item != NULL) num = item->IntVar(NAME_Amount); else @@ -2085,9 +2085,9 @@ class CommandDrawInventoryBar : public SBarInfoCommand } } - AInventory *PrevInv(AInventory *item) + AActor *PrevInv(AActor *item) { - AInventory *retval = nullptr; + AActor *retval = nullptr; IFVM(Inventory, PrevInv) { VMValue param = item; @@ -2097,9 +2097,9 @@ class CommandDrawInventoryBar : public SBarInfoCommand return retval; } - AInventory *NextInv(AInventory *item) + AActor *NextInv(AActor *item) { - AInventory *retval = nullptr; + AActor *retval = nullptr; IFVM(Inventory, NextInv) { VMValue param = item; @@ -2117,7 +2117,7 @@ class CommandDrawInventoryBar : public SBarInfoCommand if(translucent) bgalpha *= HX_SHADOW; - AInventory *item; + AActor *item; unsigned int i = 0; // If the player has no artifacts, don't draw the bar statusBar->CPlayer->mo->InvFirst = statusBar->wrapper->ValidateInvFirst(size); @@ -3074,7 +3074,7 @@ class CommandHasWeaponPiece : public SBarInfoCommandFlowControl { SBarInfoCommandFlowControl::Tick(block, statusBar, hudChanged); - for(AInventory *inv = statusBar->CPlayer->mo->Inventory;inv != NULL;inv=inv->Inventory) + for(auto inv = statusBar->CPlayer->mo->Inventory;inv != NULL;inv=inv->Inventory) { auto hc = PClass::FindActor("WeaponHolder"); if(inv->IsKindOf(hc)) @@ -3360,7 +3360,7 @@ class CommandInInventory : public SBarInfoNegatableFlowControl { SBarInfoNegatableFlowControl::Tick(block, statusBar, hudChanged); - AInventory *invItem[2] = { statusBar->CPlayer->mo->FindInventory(item[0]), statusBar->CPlayer->mo->FindInventory(item[1]) }; + AActor *invItem[2] = { statusBar->CPlayer->mo->FindInventory(item[0]), statusBar->CPlayer->mo->FindInventory(item[1]) }; if (invItem[0] != NULL && Amount[0] > 0 && invItem[0]->IntVar(NAME_Amount) < Amount[0]) invItem[0] = NULL; if (invItem[1] != NULL && Amount[1] > 0 && invItem[1]->IntVar(NAME_Amount) < Amount[1]) invItem[1] = NULL; diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index 6c3ccc839..7caef4a4b 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -1266,12 +1266,12 @@ void DBaseStatusBar::CallScreenSizeChanged() // //--------------------------------------------------------------------------- -AInventory *DBaseStatusBar::ValidateInvFirst (int numVisible) const +AActor *DBaseStatusBar::ValidateInvFirst (int numVisible) const { IFVM(BaseStatusBar, ValidateInvFirst) { - VMValue params[] = { (AInventory*)this, numVisible }; - AInventory *item; + VMValue params[] = { const_cast(this), numVisible }; + AActor *item; VMReturn ret((void**)&item); VMCall(func, params, 2, &ret, 1); return item; @@ -1757,8 +1757,7 @@ void FormatNumber(int number, int minsize, int maxsize, int flags, const FString // //--------------------------------------------------------------------------- -//FTextureID GetInventoryIcon(AInventory *item, uint32_t flags, int *applyscale) -int GetInventoryIcon(AInventory *item, uint32_t flags, int *applyscale) +int GetInventoryIcon(AActor *item, uint32_t flags, int *applyscale) { if (applyscale != NULL) { diff --git a/src/hwrenderer/scene/hw_drawinfo.cpp b/src/hwrenderer/scene/hw_drawinfo.cpp index 069824757..35b1836e0 100644 --- a/src/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/hwrenderer/scene/hw_drawinfo.cpp @@ -280,7 +280,7 @@ int HWDrawInfo::SetFullbrightFlags(player_t *player) { auto torchtype = PClass::FindActor(NAME_PowerTorch); auto litetype = PClass::FindActor(NAME_PowerLightAmp); - for (AInventory * in = cplayer->mo->Inventory; in; in = in->Inventory) + for (AActor *in = cplayer->mo->Inventory; in; in = in->Inventory) { // Need special handling for light amplifiers if (in->IsKindOf(torchtype)) diff --git a/src/namedef.h b/src/namedef.h index a965fba63..e6e409c04 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -1017,6 +1017,7 @@ xx(YAdjust) xx(Crosshair) xx(WeaponFlags) xx(DropTime) +xx(PickupSound) xx(BlueCard) xx(YellowCard) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index e5c554b14..d51120f55 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -9329,7 +9329,7 @@ scriptwait: case PCD_GETSIGILPIECES: { - AInventory *sigil; + AActor *sigil; if (activator == NULL || (sigil = activator->FindInventory(NAME_Sigil)) == NULL) { @@ -9346,11 +9346,10 @@ scriptwait: if (activator != NULL) { PClass *type = PClass::FindClass (FBehavior::StaticLookupString (STACK(1))); - AInventory *item; if (type != NULL && type->ParentClass == PClass::FindActor(NAME_Ammo)) { - item = activator->FindInventory (static_cast(type)); + auto item = activator->FindInventory (static_cast(type)); if (item != NULL) { STACK(1) = item->IntVar(NAME_MaxAmount); @@ -9375,11 +9374,10 @@ scriptwait: if (activator != NULL) { PClassActor *type = PClass::FindActor (FBehavior::StaticLookupString (STACK(2))); - AInventory *item; if (type != NULL && type->ParentClass == PClass::FindActor(NAME_Ammo)) { - item = activator->FindInventory (type); + auto item = activator->FindInventory (type); if (item != NULL) { item->IntVar(NAME_MaxAmount) = STACK(1); diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 751fdc04b..476aa8a3d 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -1541,7 +1541,7 @@ enum SW_Flags DEFINE_ACTION_FUNCTION(AActor, A_SelectWeapon) { PARAM_SELF_PROLOGUE(AActor); - PARAM_CLASS(cls, AInventory); + PARAM_CLASS(cls, AActor); PARAM_INT(flags); bool selectPriority = !!(flags & SWF_SELECTPRIORITY); @@ -2109,7 +2109,7 @@ DEFINE_ACTION_FUNCTION(AActor, CheckRange) DEFINE_ACTION_FUNCTION(AActor, A_DropInventory) { PARAM_SELF_PROLOGUE(AActor); - PARAM_CLASS(drop, AInventory); + PARAM_CLASS(drop, AActor); PARAM_INT(amount); if (drop) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index cd2bc60c0..64face0f6 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -603,12 +603,10 @@ static int FindNode (const FStrifeDialogueNode *node) static bool CheckStrifeItem (player_t *player, PClassActor *itemtype, int amount=-1) { - AInventory *item; - if (itemtype == NULL || amount == 0) return true; - item = player->ConversationPC->FindInventory (itemtype); + auto item = player->ConversationPC->FindInventory (itemtype); if (item == NULL) return false; diff --git a/src/p_enemy.h b/src/p_enemy.h index d101fceef..3a4a4e3ea 100644 --- a/src/p_enemy.h +++ b/src/p_enemy.h @@ -6,7 +6,6 @@ struct sector_t; class AActor; -class AInventory; class PClass; diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index ecd996547..53c552e12 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -324,9 +324,9 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags, FName MeansOf //flags &= ~MF_INVINCIBLE; // [RH] Notify this actor's items. - for (auto item = Inventory; item != NULL; ) + for (AActor *item = Inventory; item != NULL; ) { - AInventory *next = item->Inventory; + AActor *next = item->Inventory; IFVIRTUALPTR(item, AInventory, OwnerDied) { VMValue params[1] = { item }; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 9ad85ebd2..732236e28 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3450,9 +3450,9 @@ bool AActor::AdjustReflectionAngle (AActor *thing, DAngle &angle) int AActor::AbsorbDamage(int damage, FName dmgtype) { - for (auto item = Inventory; item != nullptr; item = item->Inventory) + for (AActor *item = Inventory; item != nullptr; item = item->Inventory) { - IFVIRTUALPTR(item, AInventory, AbsorbDamage) + IFVIRTUALPTRNAME(item, NAME_Inventory, AbsorbDamage) { VMValue params[4] = { item, damage, dmgtype.GetIndex(), &damage }; VMCall(func, params, 4, nullptr, 0); @@ -3464,15 +3464,15 @@ int AActor::AbsorbDamage(int damage, FName dmgtype) void AActor::AlterWeaponSprite(visstyle_t *vis) { int changed = 0; - TArray items; + TArray items; // This needs to go backwards through the items but the list has no backlinks. - for (auto item = Inventory; item != nullptr; item = item->Inventory) + for (AActor *item = Inventory; item != nullptr; item = item->Inventory) { items.Push(item); } for(int i=items.Size()-1;i>=0;i--) { - IFVIRTUALPTR(items[i], AInventory, AlterWeaponSprite) + IFVIRTUALPTRNAME(items[i], NAME_Inventory, AlterWeaponSprite) { VMValue params[3] = { items[i], vis, &changed }; VMCall(func, params, 3, nullptr, 0); @@ -3785,11 +3785,11 @@ void AActor::Tick () { // Handle powerup effects here so that the order is controlled // by the order in the inventory, not the order in the thinker table - auto item = Inventory; + AActor *item = Inventory; while (item != NULL) { - IFVIRTUALPTR(item, AInventory, DoEffect) + IFVIRTUALPTRNAME(item, NAME_Inventory, DoEffect) { VMValue params[1] = { item }; VMCall(func, params, 1, nullptr, 0); @@ -8129,7 +8129,7 @@ void PrintMiscActorInfo(AActor *query) /*for (flagi = 0; flagi < 31; flagi++) if (query->BounceFlags & 1<Alpha, query->renderflags.GetValue()); /*for (flagi = 0; flagi < 31; flagi++) if (query->renderflags & 1<mo, ammotype }; @@ -976,10 +976,10 @@ void APlayerPawn::GiveDeathmatchInventory() { if (PClassActor::AllActorClasses[i]->IsDescendantOf (PClass::FindActor(NAME_Key))) { - AInventory *key = (AInventory*)GetDefaultByType (PClassActor::AllActorClasses[i]); + auto key = GetDefaultByType (PClassActor::AllActorClasses[i]); if (key->special1 != 0) { - key = (AInventory*)Spawn(PClassActor::AllActorClasses[i]); + key = Spawn(PClassActor::AllActorClasses[i]); if (!CallTryPickup (key, this)) { key->Destroy (); @@ -1981,7 +1981,7 @@ void P_UnPredictPlayer () APlayerPawn *act = player->mo; AActor *savedcamera = player->camera; - TObjPtr InvSel = act->InvSel; + TObjPtr InvSel = act->InvSel; int inventorytics = player->inventorytics; *player = PredictionPlayerBackup; diff --git a/src/scripting/decorate/olddecorations.cpp b/src/scripting/decorate/olddecorations.cpp index 209bf393d..533a39e1a 100644 --- a/src/scripting/decorate/olddecorations.cpp +++ b/src/scripting/decorate/olddecorations.cpp @@ -313,7 +313,6 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def, PNamespace *ns) static void ParseInsideDecoration (Baggage &bag, AActor *defaults, FExtraInfo &extra, EDefinitionType def, FScanner &sc, TArray &StateArray, TArray &SourceLines) { - AInventory *const inv = static_cast(defaults); char sprite[5] = "TNT1"; sc.MustGetString (); @@ -532,16 +531,16 @@ static void ParseInsideDecoration (Baggage &bag, AActor *defaults, else if (def == DEF_Pickup && sc.Compare ("PickupSound")) { sc.MustGetString (); - inv->PickupSound = sc.String; + defaults->IntVar(NAME_PickupSound) = FSoundID(sc.String); } else if (def == DEF_Pickup && sc.Compare ("PickupMessage")) { sc.MustGetString (); - inv->StringVar(NAME_PickupMsg) = sc.String; + defaults->StringVar(NAME_PickupMsg) = sc.String; } else if (def == DEF_Pickup && sc.Compare ("Respawns")) { - inv->BoolVar(NAME_Respawnable) = true; + defaults->BoolVar(NAME_Respawnable) = true; } else if (def == DEF_BreakableDecoration && sc.Compare ("SolidOnDeath")) { diff --git a/src/v_blend.cpp b/src/v_blend.cpp index 5b9a55cf5..7069affe3 100644 --- a/src/v_blend.cpp +++ b/src/v_blend.cpp @@ -95,11 +95,11 @@ void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int int cnt; // [RH] All powerups can affect the screen blending now - for (auto item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory) + for (AActor *item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory) { PalEntry color = 0; - IFVIRTUALPTR(item, AInventory, GetBlend) + IFVIRTUALPTRNAME(item, NAME_Inventory, GetBlend) { VMValue params[1] = { item }; VMReturn ret((int*)&color.d); diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 502e14a29..80f51f141 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -1496,7 +1496,7 @@ void DFrameBuffer::DrawBlend(sector_t * viewsector) auto torchtype = PClass::FindActor(NAME_PowerTorch); auto litetype = PClass::FindActor(NAME_PowerLightAmp); PalEntry color = 0xffffffff; - for (AInventory * in = player->mo->Inventory; in; in = in->Inventory) + for (AActor *in = player->mo->Inventory; in; in = in->Inventory) { // Need special handling for light amplifiers if (in->IsKindOf(torchtype))