Merge branch 'maint'

This commit is contained in:
Randy Heit 2013-09-18 22:06:31 -05:00
commit fc843c28ba
10 changed files with 167 additions and 20 deletions

View file

@ -1058,4 +1058,5 @@ userinfo_t::~userinfo_t()
{ {
delete pair->Value; delete pair->Value;
} }
this->Clear();
} }

View file

@ -325,6 +325,10 @@ struct userinfo_t : TMap<FName,FBaseCVar *>
{ {
return *static_cast<FIntCVar *>(*CheckKey(NAME_Gender)); return *static_cast<FIntCVar *>(*CheckKey(NAME_Gender));
} }
bool GetNoAutostartMap() const
{
return *static_cast<FBoolCVar *>(*CheckKey(NAME_Wi_NoAutostartMap));
}
void Reset(); void Reset();
int TeamChanged(int team); int TeamChanged(int team);
@ -348,6 +352,7 @@ class player_t
{ {
public: public:
player_t(); player_t();
player_t &operator= (const player_t &p);
void Serialize (FArchive &arc); void Serialize (FArchive &arc);
size_t FixPointers (const DObject *obj, DObject *replacement); size_t FixPointers (const DObject *obj, DObject *replacement);

View file

@ -53,7 +53,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
angle += pr_punch.Random2() << 18; angle += pr_punch.Random2() << 18;
pitch = P_AimLineAttack (self, angle, MELEERANGE, &linetarget); 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 // turn to face target
if (linetarget) if (linetarget)

View file

@ -166,15 +166,18 @@ public:
NewWidth = SCREENWIDTH; NewWidth = SCREENWIDTH;
NewHeight = SCREENHEIGHT; NewHeight = SCREENHEIGHT;
} }
OldWidth = SCREENWIDTH; else
OldHeight = SCREENHEIGHT; {
OldBits = DisplayBits; OldWidth = SCREENWIDTH;
NewBits = BitTranslate[DummyDepthCvar]; OldHeight = SCREENHEIGHT;
setmodeneeded = true; OldBits = DisplayBits;
testingmode = I_GetTime(false) + 5 * TICRATE; NewBits = BitTranslate[DummyDepthCvar];
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE); setmodeneeded = true;
SetModesMenu (NewWidth, NewHeight, NewBits); testingmode = I_GetTime(false) + 5 * TICRATE;
return true; S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE);
SetModesMenu (NewWidth, NewHeight, NewBits);
return true;
}
} }
return Super::Responder(ev); return Super::Responder(ev);
} }
@ -348,7 +351,7 @@ void M_InitVideoModesMenu ()
static bool GetSelectedSize (int *width, int *height) static bool GetSelectedSize (int *width, int *height)
{ {
FOptionMenuDescriptor *opt = GetVideoModeMenu(); FOptionMenuDescriptor *opt = GetVideoModeMenu();
if (opt != NULL) if (opt != NULL && (unsigned)opt->mSelectedItem < opt->mItems.Size())
{ {
int line = opt->mSelectedItem; int line = opt->mSelectedItem;
int hsel; int hsel;

View file

@ -568,3 +568,4 @@ xx(NeverSwitchOnPickup)
xx(MoveBob) xx(MoveBob)
xx(StillBob) xx(StillBob)
xx(PlayerClass) xx(PlayerClass)
xx(Wi_NoAutostartMap)

View file

@ -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. // MBF's monster_backing option. Made an actor flag instead. Also cleaned the code up to make it readable.
// Todo: implement the movement logic // Todo: implement the movement logic
AActor *target = actor->target; AActor *target = actor->target;
if (target->health > 0 && !actor->IsFriend(target)) if (target->health > 0 && !actor->IsFriend(target) && target != actor->goal)
{ // Live enemy target { // Live enemy target
if (actor->flags3 & MF3_AVOIDMELEE) if (actor->flags3 & MF3_AVOIDMELEE)

View file

@ -1562,9 +1562,21 @@ FUNC(LS_Thing_SetGoal)
ok = true; ok = true;
if (self->flags & MF_SHOOTABLE) 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; self->goal = goal;
if (arg3 == 0) self->flags5 &=~ MF5_CHASEGOAL; if (arg3 == 0)
else self->flags5 |= MF5_CHASEGOAL; {
self->flags5 &= ~MF5_CHASEGOAL;
}
else
{
self->flags5 |= MF5_CHASEGOAL;
}
if (self->target == NULL) if (self->target == NULL)
{ {
self->reactiontime = arg2 * TICRATE; self->reactiontime = arg2 * TICRATE;

View file

@ -314,6 +314,115 @@ player_t::player_t()
memset (&skill, 0, sizeof(skill)); 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 // This function supplements the pointer cleanup in dobject.cpp, because
// player_t is not derived from DObject. (I tried it, and DestroyScan was // player_t is not derived from DObject. (I tried it, and DestroyScan was
// unable to properly determine the player object's type--possibly // unable to properly determine the player object's type--possibly

View file

@ -1404,7 +1404,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
} }
if (!PuffType) PuffType = PClass::FindClass(NAME_BulletPuff); 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); 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_PULLIN) self->flags |= MF_JUSTATTACKED;
if (flags & CPF_DAGGER) P_DaggerAlert (self, linetarget); if (flags & CPF_DAGGER) P_DaggerAlert (self, linetarget);
} }
} }

View file

@ -62,7 +62,7 @@ typedef enum
CVAR (Bool, wi_percents, true, CVAR_ARCHIVE) CVAR (Bool, wi_percents, true, CVAR_ARCHIVE)
CVAR (Bool, wi_showtotaltime, 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 (); void WI_loadData ();
@ -1098,11 +1098,28 @@ void WI_updateNoState ()
{ {
WI_updateAnimatedBack(); WI_updateAnimatedBack();
if (acceleratestage)
{
cnt = 0;
}
else
{
bool noauto = noautostartmap;
if (!wi_noautostartmap && !noautostartmap) cnt--; for (int i = 0; !noauto && i < MAXPLAYERS; ++i)
if (acceleratestage) cnt=0; {
if (playeringame[i])
{
noauto |= players[i].userinfo.GetNoAutostartMap();
}
}
if (!noauto)
{
cnt--;
}
}
if (cnt==0) if (cnt == 0)
{ {
WI_End(); WI_End();
G_WorldDone(); G_WorldDone();