mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-21 10:51:25 +00:00
- Removed unnecessary 'id' variable from AActor.
- Removed unused 'backpack' variable from player_t. - Removed duplicate code from b_move.cpp. - General cleanup.
This commit is contained in:
parent
0f19356e24
commit
5de6b535ae
9 changed files with 20 additions and 43 deletions
|
@ -937,9 +937,6 @@ public:
|
||||||
TObjPtr<AInventory> Inventory; // [RH] This actor's inventory
|
TObjPtr<AInventory> Inventory; // [RH] This actor's inventory
|
||||||
DWORD InventoryID; // A unique ID to keep track of inventory items
|
DWORD InventoryID; // A unique ID to keep track of inventory items
|
||||||
|
|
||||||
//Added by MC:
|
|
||||||
SDWORD id; // Player ID (for items, # in list.)
|
|
||||||
|
|
||||||
BYTE smokecounter;
|
BYTE smokecounter;
|
||||||
BYTE FloatBobPhase;
|
BYTE FloatBobPhase;
|
||||||
BYTE FriendPlayer; // [RH] Player # + 1 this friendly monster works for (so 0 is no player, 1 is player 0, etc)
|
BYTE FriendPlayer; // [RH] Player # + 1 this friendly monster works for (so 0 is no player, 1 is player 0, etc)
|
||||||
|
|
|
@ -249,7 +249,7 @@ shootmissile:
|
||||||
|
|
||||||
if (m)
|
if (m)
|
||||||
{
|
{
|
||||||
if (inc[actor->id])
|
if (inc[actor->player - players])
|
||||||
actor->player->angle += m;
|
actor->player->angle += m;
|
||||||
else
|
else
|
||||||
actor->player->angle -= m;
|
actor->player->angle -= m;
|
||||||
|
@ -257,7 +257,7 @@ shootmissile:
|
||||||
|
|
||||||
if (abs (actor->player->angle - actor->angle) < 4*ANGLE_1)
|
if (abs (actor->player->angle - actor->angle) < 4*ANGLE_1)
|
||||||
{
|
{
|
||||||
inc[actor->id] = !inc[actor->id];
|
inc[actor->player - players] = !inc[actor->player - players];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Check_LOS (actor, enemy, (SHOOTFOV/2)))
|
if (Check_LOS (actor, enemy, (SHOOTFOV/2)))
|
||||||
|
|
|
@ -17,20 +17,7 @@
|
||||||
#include "gi.h"
|
#include "gi.h"
|
||||||
#include "a_keys.h"
|
#include "a_keys.h"
|
||||||
#include "d_event.h"
|
#include "d_event.h"
|
||||||
|
#include "p_enemy.h"
|
||||||
enum dirtype_t
|
|
||||||
{
|
|
||||||
DI_EAST,
|
|
||||||
DI_NORTHEAST,
|
|
||||||
DI_NORTH,
|
|
||||||
DI_NORTHWEST,
|
|
||||||
DI_WEST,
|
|
||||||
DI_SOUTHWEST,
|
|
||||||
DI_SOUTH,
|
|
||||||
DI_SOUTHEAST,
|
|
||||||
DI_NODIR,
|
|
||||||
NUMDIRS
|
|
||||||
};
|
|
||||||
|
|
||||||
static FRandom pr_botopendoor ("BotOpenDoor");
|
static FRandom pr_botopendoor ("BotOpenDoor");
|
||||||
static FRandom pr_bottrywalk ("BotTryWalk");
|
static FRandom pr_bottrywalk ("BotTryWalk");
|
||||||
|
@ -39,10 +26,6 @@ static FRandom pr_botnewchasedir ("BotNewChaseDir");
|
||||||
// borrow some tables from p_enemy.cpp
|
// borrow some tables from p_enemy.cpp
|
||||||
extern dirtype_t opposite[9];
|
extern dirtype_t opposite[9];
|
||||||
extern dirtype_t diags[4];
|
extern dirtype_t diags[4];
|
||||||
extern fixed_t xspeed[8];
|
|
||||||
extern fixed_t yspeed[8];
|
|
||||||
|
|
||||||
extern TArray<line_t *> spechit;
|
|
||||||
|
|
||||||
//Called while the bot moves after its player->dest mobj
|
//Called while the bot moves after its player->dest mobj
|
||||||
//which can be a weapon/enemy/item whatever.
|
//which can be a weapon/enemy/item whatever.
|
||||||
|
|
|
@ -60,9 +60,6 @@
|
||||||
|
|
||||||
static FRandom pr_pickteam ("PickRandomTeam");
|
static FRandom pr_pickteam ("PickRandomTeam");
|
||||||
|
|
||||||
extern bool st_firsttime;
|
|
||||||
EXTERN_CVAR (Bool, teamplay)
|
|
||||||
|
|
||||||
CVAR (Float, autoaim, 5000.f, CVAR_USERINFO | CVAR_ARCHIVE);
|
CVAR (Float, autoaim, 5000.f, CVAR_USERINFO | CVAR_ARCHIVE);
|
||||||
CVAR (String, name, "Player", CVAR_USERINFO | CVAR_ARCHIVE);
|
CVAR (String, name, "Player", CVAR_USERINFO | CVAR_ARCHIVE);
|
||||||
CVAR (Color, color, 0x40cf00, CVAR_USERINFO | CVAR_ARCHIVE);
|
CVAR (Color, color, 0x40cf00, CVAR_USERINFO | CVAR_ARCHIVE);
|
||||||
|
|
|
@ -76,8 +76,6 @@ FPlayerColorSet *P_GetPlayerColorSet(FName classname, int setnum);
|
||||||
void P_EnumPlayerColorSets(FName classname, TArray<int> *out);
|
void P_EnumPlayerColorSets(FName classname, TArray<int> *out);
|
||||||
const char *GetPrintableDisplayName(const PClass *cls);
|
const char *GetPrintableDisplayName(const PClass *cls);
|
||||||
|
|
||||||
class player_t;
|
|
||||||
|
|
||||||
class APlayerPawn : public AActor
|
class APlayerPawn : public AActor
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (APlayerPawn, AActor)
|
DECLARE_CLASS (APlayerPawn, AActor)
|
||||||
|
@ -398,8 +396,7 @@ public:
|
||||||
|
|
||||||
int inventorytics;
|
int inventorytics;
|
||||||
BYTE CurrentPlayerClass; // class # for this player instance
|
BYTE CurrentPlayerClass; // class # for this player instance
|
||||||
bool backpack;
|
|
||||||
|
|
||||||
int frags[MAXPLAYERS]; // kills of other players
|
int frags[MAXPLAYERS]; // kills of other players
|
||||||
int fragcount; // [RH] Cumulative frags for this player
|
int fragcount; // [RH] Cumulative frags for this player
|
||||||
int lastkilltime; // [RH] For multikills
|
int lastkilltime; // [RH] For multikills
|
||||||
|
|
|
@ -1025,7 +1025,7 @@ void AInventory::Touch (AActor *toucher)
|
||||||
for (int i = 0; i < MAXPLAYERS; i++)
|
for (int i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (playeringame[i] && this == players[i].dest)
|
if (playeringame[i] && this == players[i].dest)
|
||||||
players[i].dest = NULL;
|
players[i].dest = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -252,9 +252,13 @@ void AActor::Serialize (FArchive &arc)
|
||||||
<< MinMissileChance
|
<< MinMissileChance
|
||||||
<< SpawnFlags
|
<< SpawnFlags
|
||||||
<< Inventory
|
<< Inventory
|
||||||
<< InventoryID
|
<< InventoryID;
|
||||||
<< id
|
if (SaveVersion < 4513)
|
||||||
<< FloatBobPhase
|
{
|
||||||
|
SDWORD id;
|
||||||
|
arc << id;
|
||||||
|
}
|
||||||
|
arc << FloatBobPhase
|
||||||
<< Translation
|
<< Translation
|
||||||
<< SeeSound
|
<< SeeSound
|
||||||
<< AttackSound
|
<< AttackSound
|
||||||
|
@ -4358,9 +4362,6 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
||||||
mobj->pitch = mobj->roll = 0;
|
mobj->pitch = mobj->roll = 0;
|
||||||
mobj->health = p->health;
|
mobj->health = p->health;
|
||||||
|
|
||||||
//Added by MC: Identification (number in the players[MAXPLAYERS] array)
|
|
||||||
mobj->id = playernum;
|
|
||||||
|
|
||||||
// [RH] Set player sprite based on skin
|
// [RH] Set player sprite based on skin
|
||||||
if (!(mobj->flags4 & MF4_NOSKIN))
|
if (!(mobj->flags4 & MF4_NOSKIN))
|
||||||
{
|
{
|
||||||
|
|
|
@ -240,7 +240,6 @@ player_t::player_t()
|
||||||
health(0),
|
health(0),
|
||||||
inventorytics(0),
|
inventorytics(0),
|
||||||
CurrentPlayerClass(0),
|
CurrentPlayerClass(0),
|
||||||
backpack(0),
|
|
||||||
fragcount(0),
|
fragcount(0),
|
||||||
lastkilltime(0),
|
lastkilltime(0),
|
||||||
multicount(0),
|
multicount(0),
|
||||||
|
@ -341,7 +340,6 @@ player_t &player_t::operator=(const player_t &p)
|
||||||
health = p.health;
|
health = p.health;
|
||||||
inventorytics = p.inventorytics;
|
inventorytics = p.inventorytics;
|
||||||
CurrentPlayerClass = p.CurrentPlayerClass;
|
CurrentPlayerClass = p.CurrentPlayerClass;
|
||||||
backpack = p.backpack;
|
|
||||||
memcpy(frags, &p.frags, sizeof(frags));
|
memcpy(frags, &p.frags, sizeof(frags));
|
||||||
fragcount = p.fragcount;
|
fragcount = p.fragcount;
|
||||||
lastkilltime = p.lastkilltime;
|
lastkilltime = p.lastkilltime;
|
||||||
|
@ -2889,9 +2887,13 @@ void player_t::Serialize (FArchive &arc)
|
||||||
<< vely
|
<< vely
|
||||||
<< centering
|
<< centering
|
||||||
<< health
|
<< health
|
||||||
<< inventorytics
|
<< inventorytics;
|
||||||
<< backpack
|
if (SaveVersion < 4513)
|
||||||
<< fragcount
|
{
|
||||||
|
bool backpack;
|
||||||
|
arc << backpack;
|
||||||
|
}
|
||||||
|
arc << fragcount
|
||||||
<< spreecount
|
<< spreecount
|
||||||
<< multicount
|
<< multicount
|
||||||
<< lastkilltime
|
<< lastkilltime
|
||||||
|
|
|
@ -76,7 +76,7 @@ const char *GetVersionString();
|
||||||
|
|
||||||
// Use 4500 as the base git save version, since it's higher than the
|
// Use 4500 as the base git save version, since it's higher than the
|
||||||
// SVN revision ever got.
|
// SVN revision ever got.
|
||||||
#define SAVEVER 4512
|
#define SAVEVER 4513
|
||||||
|
|
||||||
#define SAVEVERSTRINGIFY2(x) #x
|
#define SAVEVERSTRINGIFY2(x) #x
|
||||||
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)
|
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)
|
||||||
|
|
Loading…
Reference in a new issue