- Fixed: Not all places checking for player start spots above 4 did it correctly.

The editor number for player start spot 5 is now stored in the game info
  so that there's only one place where this check needs to be done.
- Fixed: WIF_NOAUTOAIM only worked for projectiles unlike Skulltag's original
  implementation.


SVN r1997 (trunk)
This commit is contained in:
Christoph Oelckers 2009-11-24 06:55:38 +00:00
parent 53b1b7efab
commit f94c9ce81d
11 changed files with 35 additions and 26 deletions

View file

@ -1,3 +1,9 @@
November 24, 2009 (Changes by Graf Zahl)
- Fixed: Not all places checking for player start spots did it correctly.
The editor number for player start spot 5 is now stored in the game info
so that there's only one place where this check needs to be done.
- Fixed: WIF_NOAUTOAIM only worked for projectiles.
November 23, 2009
- Added Windows 7 (aka Windows NT 6.1) and Server 2008 identification to
I_DetectOS().

View file

@ -1475,10 +1475,8 @@ void G_DeathMatchSpawnPlayer (int playernum)
{
if (playernum < 4)
spot->type = playernum+1;
else if (gameinfo.gametype != GAME_Hexen)
spot->type = playernum+4001-4; // [RH] > 4 players
else
spot->type = playernum+9100-4;
else
spot->type = playernum + gameinfo.player5start - 4;
}
AActor *mo = P_SpawnPlayer (spot);
@ -1569,17 +1567,13 @@ void G_DoReborn (int playernum, bool freshbot)
// fake as other player
// [RH] These numbers should be common across all games. Or better yet, not
// used at all outside P_SpawnMapThing().
if (playernum < 4 || gameinfo.gametype == GAME_Strife)
if (playernum < 4)
{
playerstarts[i].type = playernum + 1;
}
else if (gameinfo.gametype == GAME_Hexen)
{
playerstarts[i].type = playernum + 9100 - 4;
}
else
{
playerstarts[i].type = playernum + 4001 - 4;
playerstarts[i].type = playernum + gameinfo.player5start - 4;
}
AActor *mo = P_SpawnPlayer (&playerstarts[i]);
if (mo != NULL) P_PlayerStartStomp(mo);

View file

@ -281,6 +281,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultdropstyle, "defaultdropstyle")
GAMEINFOKEY_CSTRING(Endoom, "endoom", 8)
GAMEINFOKEY_INT(player5start, "player5start")
else
{
// ignore unkown keys.

View file

@ -103,6 +103,7 @@ struct gameinfo_t
int definventorymaxamount;
int defaultrespawntime;
int defaultdropstyle;
int player5start;
const char *GetFinalePage(unsigned int num) const;
};

View file

@ -3157,11 +3157,20 @@ fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **p
}
else
{
// 35 degrees is approximately what Doom used. You cannot have a
// vrange of 0 degrees, because then toppitch and bottompitch will
// be equal, and PTR_AimTraverse will never find anything to shoot at
// if it crosses a line.
vrange = clamp (t1->player->userinfo.GetAimDist(), ANGLE_1/2, ANGLE_1*35);
// [BB] Disable autoaim on weapons with WIF_NOAUTOAIM.
AWeapon *weapon = t1->player->ReadyWeapon;
if ( weapon && (weapon->WeaponFlags & WIF_NOAUTOAIM) )
{
vrange = ANGLE_1/2;
}
else
{
// 35 degrees is approximately what Doom used. You cannot have a
// vrange of 0 degrees, because then toppitch and bottompitch will
// be equal, and PTR_AimTraverse will never find anything to shoot at
// if it crosses a line.
vrange = clamp (t1->player->userinfo.aimdist, ANGLE_1/2, ANGLE_1*35);
}
}
}
aim.toppitch = t1->pitch - vrange;

View file

@ -3838,17 +3838,13 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
// [RH] Things 4001-? are also multiplayer starts. Just like 1-4.
// To make things simpler, figure out which player is being
// spawned here.
if (mthing->type <= 4 || gameinfo.gametype == GAME_Strife) // don't forget Strife's starts 5-8 here!
if (mthing->type <= 4)
{
playernum = mthing->type - 1;
}
else if (gameinfo.gametype != GAME_Hexen)
{
playernum = mthing->type - 4001 + 4;
}
else
{
playernum = mthing->type - 9100 + 4;
playernum = mthing->type - gameinfo.player5start + 4;
}
// not playing?
@ -4140,12 +4136,9 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
}
else
{
const int base = (gameinfo.gametype == GAME_Strife) ? 5 :
(gameinfo.gametype == GAME_Hexen) ? 9100 : 4001;
if (mthing->type >= base && mthing->type < base + MAXPLAYERS - 4)
if (mthing->type >= gameinfo.player5start && mthing->type < gameinfo.player5start + MAXPLAYERS - 4)
{
pnum = mthing->type - base + 4;
pnum = mthing->type - gameinfo.player5start + 4;
}
}

View file

@ -40,6 +40,7 @@ gameinfo
defaultrespawntime = 12
defaultdropstyle = 1
endoom = "ENDOOM"
player5start = 4001
}
skill baby

View file

@ -39,6 +39,7 @@ gameinfo
defaultrespawntime = 12
defaultdropstyle = 1
endoom = "ENDOOM"
player5start = 4001
}
skill baby

View file

@ -40,6 +40,7 @@ gameinfo
defaultrespawntime = 12
defaultdropstyle = 1
endoom = "ENDTEXT"
player5start = 4001
}
skill baby

View file

@ -38,6 +38,7 @@ gameinfo
definventorymaxamount = 25
defaultrespawntime = 12
defaultdropstyle = 1
player5start = 9100
}
skill baby

View file

@ -41,6 +41,7 @@ gameinfo
defaultrespawntime = 16
defaultdropstyle = 2
endoom = "ENDSTRF"
player5start = 5
}
skill baby