mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
Merge branch 'maint'
This commit is contained in:
commit
fc843c28ba
10 changed files with 167 additions and 20 deletions
|
@ -1058,4 +1058,5 @@ userinfo_t::~userinfo_t()
|
|||
{
|
||||
delete pair->Value;
|
||||
}
|
||||
this->Clear();
|
||||
}
|
||||
|
|
|
@ -325,6 +325,10 @@ struct userinfo_t : TMap<FName,FBaseCVar *>
|
|||
{
|
||||
return *static_cast<FIntCVar *>(*CheckKey(NAME_Gender));
|
||||
}
|
||||
bool GetNoAutostartMap() const
|
||||
{
|
||||
return *static_cast<FBoolCVar *>(*CheckKey(NAME_Wi_NoAutostartMap));
|
||||
}
|
||||
|
||||
void Reset();
|
||||
int TeamChanged(int team);
|
||||
|
@ -348,6 +352,7 @@ class player_t
|
|||
{
|
||||
public:
|
||||
player_t();
|
||||
player_t &operator= (const player_t &p);
|
||||
|
||||
void Serialize (FArchive &arc);
|
||||
size_t FixPointers (const DObject *obj, DObject *replacement);
|
||||
|
|
|
@ -53,7 +53,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
|
|||
angle += pr_punch.Random2() << 18;
|
||||
pitch = P_AimLineAttack (self, angle, MELEERANGE, &linetarget);
|
||||
|
||||
P_LineAttack (self, angle, MELEERANGE, pitch, damage, NAME_Melee, NAME_BulletPuff, true, &linetarget);
|
||||
P_LineAttack (self, angle, MELEERANGE, pitch, damage, NAME_Melee, NAME_BulletPuff, LAF_ISMELEEATTACK, &linetarget);
|
||||
|
||||
// turn to face target
|
||||
if (linetarget)
|
||||
|
|
|
@ -166,6 +166,8 @@ public:
|
|||
NewWidth = SCREENWIDTH;
|
||||
NewHeight = SCREENHEIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
OldWidth = SCREENWIDTH;
|
||||
OldHeight = SCREENHEIGHT;
|
||||
OldBits = DisplayBits;
|
||||
|
@ -176,6 +178,7 @@ public:
|
|||
SetModesMenu (NewWidth, NewHeight, NewBits);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Super::Responder(ev);
|
||||
}
|
||||
};
|
||||
|
@ -348,7 +351,7 @@ void M_InitVideoModesMenu ()
|
|||
static bool GetSelectedSize (int *width, int *height)
|
||||
{
|
||||
FOptionMenuDescriptor *opt = GetVideoModeMenu();
|
||||
if (opt != NULL)
|
||||
if (opt != NULL && (unsigned)opt->mSelectedItem < opt->mItems.Size())
|
||||
{
|
||||
int line = opt->mSelectedItem;
|
||||
int hsel;
|
||||
|
|
|
@ -568,3 +568,4 @@ xx(NeverSwitchOnPickup)
|
|||
xx(MoveBob)
|
||||
xx(StillBob)
|
||||
xx(PlayerClass)
|
||||
xx(Wi_NoAutostartMap)
|
|
@ -915,7 +915,7 @@ void P_NewChaseDir(AActor * actor)
|
|||
// MBF's monster_backing option. Made an actor flag instead. Also cleaned the code up to make it readable.
|
||||
// Todo: implement the movement logic
|
||||
AActor *target = actor->target;
|
||||
if (target->health > 0 && !actor->IsFriend(target))
|
||||
if (target->health > 0 && !actor->IsFriend(target) && target != actor->goal)
|
||||
{ // Live enemy target
|
||||
|
||||
if (actor->flags3 & MF3_AVOIDMELEE)
|
||||
|
|
|
@ -1562,9 +1562,21 @@ FUNC(LS_Thing_SetGoal)
|
|||
ok = true;
|
||||
if (self->flags & MF_SHOOTABLE)
|
||||
{
|
||||
if (self->target == self->goal)
|
||||
{ // Targeting a goal already? -> don't target it anymore.
|
||||
// A_Look will set it to the goal, presuming no real targets
|
||||
// come into view by then.
|
||||
self->target = NULL;
|
||||
}
|
||||
self->goal = goal;
|
||||
if (arg3 == 0) self->flags5 &=~ MF5_CHASEGOAL;
|
||||
else self->flags5 |= MF5_CHASEGOAL;
|
||||
if (arg3 == 0)
|
||||
{
|
||||
self->flags5 &= ~MF5_CHASEGOAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->flags5 |= MF5_CHASEGOAL;
|
||||
}
|
||||
if (self->target == NULL)
|
||||
{
|
||||
self->reactiontime = arg2 * TICRATE;
|
||||
|
|
109
src/p_user.cpp
109
src/p_user.cpp
|
@ -314,6 +314,115 @@ player_t::player_t()
|
|||
memset (&skill, 0, sizeof(skill));
|
||||
}
|
||||
|
||||
player_t &player_t::operator=(const player_t &p)
|
||||
{
|
||||
mo = p.mo;
|
||||
playerstate = p.playerstate;
|
||||
cmd = p.cmd;
|
||||
original_cmd = p.original_cmd;
|
||||
original_oldbuttons = p.original_oldbuttons;
|
||||
// Intentionally not copying userinfo!
|
||||
cls = p.cls;
|
||||
DesiredFOV = p.DesiredFOV;
|
||||
FOV = p.FOV;
|
||||
viewz = p.viewz;
|
||||
viewheight = p.viewheight;
|
||||
deltaviewheight = p.deltaviewheight;
|
||||
bob = p.bob;
|
||||
velx = p.velx;
|
||||
vely = p.vely;
|
||||
centering = p.centering;
|
||||
turnticks = p.turnticks;
|
||||
attackdown = p.attackdown;
|
||||
usedown = p.usedown;
|
||||
oldbuttons = p.oldbuttons;
|
||||
health = p.health;
|
||||
inventorytics = p.inventorytics;
|
||||
CurrentPlayerClass = p.CurrentPlayerClass;
|
||||
backpack = p.backpack;
|
||||
memcpy(frags, &p.frags, sizeof(frags));
|
||||
fragcount = p.fragcount;
|
||||
lastkilltime = p.lastkilltime;
|
||||
multicount = p.multicount;
|
||||
spreecount = p.spreecount;
|
||||
WeaponState = p.WeaponState;
|
||||
ReadyWeapon = p.ReadyWeapon;
|
||||
PendingWeapon = p.PendingWeapon;
|
||||
cheats = p.cheats;
|
||||
timefreezer = p.timefreezer;
|
||||
refire = p.refire;
|
||||
inconsistant = p.inconsistant;
|
||||
waiting = p.waiting;
|
||||
killcount = p.killcount;
|
||||
itemcount = p.itemcount;
|
||||
secretcount = p.secretcount;
|
||||
damagecount = p.damagecount;
|
||||
bonuscount = p.bonuscount;
|
||||
hazardcount = p.hazardcount;
|
||||
poisoncount = p.poisoncount;
|
||||
poisontype = p.poisontype;
|
||||
poisonpaintype = p.poisonpaintype;
|
||||
poisoner = p.poisoner;
|
||||
attacker = p.attacker;
|
||||
extralight = p.extralight;
|
||||
fixedcolormap = p.fixedcolormap;
|
||||
fixedlightlevel = p.fixedlightlevel;
|
||||
memcpy(psprites, &p.psprites, sizeof(psprites));
|
||||
morphTics = p.morphTics;
|
||||
MorphedPlayerClass = p.MorphedPlayerClass;
|
||||
MorphStyle = p.MorphStyle;
|
||||
MorphExitFlash = p.MorphExitFlash;
|
||||
PremorphWeapon = p.PremorphWeapon;
|
||||
chickenPeck = p.chickenPeck;
|
||||
jumpTics = p.jumpTics;
|
||||
respawn_time = p.respawn_time;
|
||||
camera = p.camera;
|
||||
air_finished = p.air_finished;
|
||||
LastDamageType = p.LastDamageType;
|
||||
savedyaw = p.savedyaw;
|
||||
savedpitch = p.savedpitch;
|
||||
angle = p.angle;
|
||||
dest = p.dest;
|
||||
prev = p.prev;
|
||||
enemy = p.enemy;
|
||||
missile = p.missile;
|
||||
mate = p.mate;
|
||||
last_mate = p.last_mate;
|
||||
settings_controller = p.settings_controller;
|
||||
skill = p.skill;
|
||||
t_active = p.t_active;
|
||||
t_respawn = p.t_respawn;
|
||||
t_strafe = p.t_strafe;
|
||||
t_react = p.t_react;
|
||||
t_fight = p.t_fight;
|
||||
t_roam = p.t_roam;
|
||||
t_rocket = p.t_rocket;
|
||||
isbot = p.isbot;
|
||||
first_shot = p.first_shot;
|
||||
sleft = p.sleft;
|
||||
allround = p.allround;
|
||||
oldx = p.oldx;
|
||||
oldy = p.oldy;
|
||||
BlendR = p.BlendR;
|
||||
BlendG = p.BlendG;
|
||||
BlendB = p.BlendB;
|
||||
BlendA = p.BlendA;
|
||||
LogText = p.LogText;
|
||||
MinPitch = p.MinPitch;
|
||||
MaxPitch = p.MaxPitch;
|
||||
crouching = p.crouching;
|
||||
crouchdir = p.crouchdir;
|
||||
crouchfactor = p.crouchfactor;
|
||||
crouchoffset = p.crouchoffset;
|
||||
crouchviewdelta = p.crouchviewdelta;
|
||||
weapons = p.weapons;
|
||||
ConversationNPC = p.ConversationNPC;
|
||||
ConversationPC = p.ConversationPC;
|
||||
ConversationNPCAngle = p.ConversationNPCAngle;
|
||||
ConversationFaceTalker = p.ConversationFaceTalker;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// This function supplements the pointer cleanup in dobject.cpp, because
|
||||
// player_t is not derived from DObject. (I tried it, and DestroyScan was
|
||||
// unable to properly determine the player object's type--possibly
|
||||
|
|
|
@ -1404,7 +1404,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
}
|
||||
|
||||
if (!PuffType) PuffType = PClass::FindClass(NAME_BulletPuff);
|
||||
int puffFlags = LAF_ISMELEEATTACK | (flags & CPF_NORANDOMPUFFZ)? LAF_NORANDOMPUFFZ : 0;
|
||||
int puffFlags = LAF_ISMELEEATTACK | ((flags & CPF_NORANDOMPUFFZ) ? LAF_NORANDOMPUFFZ : 0);
|
||||
|
||||
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget, &actualdamage);
|
||||
|
||||
|
@ -1426,7 +1426,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
|
||||
if (flags & CPF_PULLIN) self->flags |= MF_JUSTATTACKED;
|
||||
if (flags & CPF_DAGGER) P_DaggerAlert (self, linetarget);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ typedef enum
|
|||
|
||||
CVAR (Bool, wi_percents, true, CVAR_ARCHIVE)
|
||||
CVAR (Bool, wi_showtotaltime, true, CVAR_ARCHIVE)
|
||||
CVAR (Bool, wi_noautostartmap, false, CVAR_ARCHIVE)
|
||||
CVAR (Bool, wi_noautostartmap, false, CVAR_USERINFO|CVAR_ARCHIVE)
|
||||
|
||||
|
||||
void WI_loadData ();
|
||||
|
@ -1098,11 +1098,28 @@ void WI_updateNoState ()
|
|||
{
|
||||
WI_updateAnimatedBack();
|
||||
|
||||
if (acceleratestage)
|
||||
{
|
||||
cnt = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool noauto = noautostartmap;
|
||||
|
||||
if (!wi_noautostartmap && !noautostartmap) cnt--;
|
||||
if (acceleratestage) cnt=0;
|
||||
for (int i = 0; !noauto && i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (playeringame[i])
|
||||
{
|
||||
noauto |= players[i].userinfo.GetNoAutostartMap();
|
||||
}
|
||||
}
|
||||
if (!noauto)
|
||||
{
|
||||
cnt--;
|
||||
}
|
||||
}
|
||||
|
||||
if (cnt==0)
|
||||
if (cnt == 0)
|
||||
{
|
||||
WI_End();
|
||||
G_WorldDone();
|
||||
|
|
Loading…
Reference in a new issue