Permalink
Browse files

Removed more literal references to AInventory.

  • Loading branch information...
coelckers committed Dec 4, 2018
1 parent 3d28006 commit cd563cc4db4fa8919d18cec5a920c4d8bba3a19c
@@ -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<AInventory *>(t));
int c = P_GetMapColorForKey(t);
if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c));
else color = AMColors[AMColors.ThingColor_CountItem];
@@ -99,7 +99,7 @@ using BotInfoMap = TMap<FName, BotInfoData>;
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 @@ class FCajunMaster
botinfo_t *botinfo;
int spawn_tries;
int wanted_botnum;
TObjPtr<AInventory*> firstthing;
TObjPtr<AActor*> firstthing;
TObjPtr<AActor*> body1;
TObjPtr<AActor*> body2;
@@ -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 };
@@ -94,8 +94,7 @@ class APlayerPawn : public AActor
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 @@ class APlayerPawn : public AActor
int RunHealth;
int PlayerFlags;
double FullHeight;
TObjPtr<AInventory*> InvFirst; // first inventory item displayed on inventory bar
TObjPtr<AInventory*> InvSel; // selected inventory item
TObjPtr<AActor*> InvFirst; // first inventory item displayed on inventory bar
TObjPtr<AActor*> InvSel; // selected inventory item
// [GRB] Player class properties
double JumpZ;
@@ -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.
@@ -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);
DEFINE_GLOBAL(netgame);
@@ -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;
@@ -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;
@@ -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);
@@ -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);
@@ -89,7 +89,7 @@ class AInventory : public AActor
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__
@@ -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)
@@ -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<APlayerPawn> 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);
@@ -460,7 +460,7 @@ class DBaseStatusBar : public DObject
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
@@ -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;
Oops, something went wrong.

0 comments on commit cd563cc

Please sign in to comment.