- 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 November 23, 2009
- Added Windows 7 (aka Windows NT 6.1) and Server 2008 identification to - Added Windows 7 (aka Windows NT 6.1) and Server 2008 identification to
I_DetectOS(). I_DetectOS().

View file

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

View file

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

View file

@ -103,6 +103,7 @@ struct gameinfo_t
int definventorymaxamount; int definventorymaxamount;
int defaultrespawntime; int defaultrespawntime;
int defaultdropstyle; int defaultdropstyle;
int player5start;
const char *GetFinalePage(unsigned int num) const; 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 else
{ {
// 35 degrees is approximately what Doom used. You cannot have a // [BB] Disable autoaim on weapons with WIF_NOAUTOAIM.
// vrange of 0 degrees, because then toppitch and bottompitch will AWeapon *weapon = t1->player->ReadyWeapon;
// be equal, and PTR_AimTraverse will never find anything to shoot at if ( weapon && (weapon->WeaponFlags & WIF_NOAUTOAIM) )
// if it crosses a line. {
vrange = clamp (t1->player->userinfo.GetAimDist(), ANGLE_1/2, ANGLE_1*35); 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; 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. // [RH] Things 4001-? are also multiplayer starts. Just like 1-4.
// To make things simpler, figure out which player is being // To make things simpler, figure out which player is being
// spawned here. // 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; playernum = mthing->type - 1;
} }
else if (gameinfo.gametype != GAME_Hexen)
{
playernum = mthing->type - 4001 + 4;
}
else else
{ {
playernum = mthing->type - 9100 + 4; playernum = mthing->type - gameinfo.player5start + 4;
} }
// not playing? // not playing?
@ -4140,12 +4136,9 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
} }
else else
{ {
const int base = (gameinfo.gametype == GAME_Strife) ? 5 : if (mthing->type >= gameinfo.player5start && mthing->type < gameinfo.player5start + MAXPLAYERS - 4)
(gameinfo.gametype == GAME_Hexen) ? 9100 : 4001;
if (mthing->type >= base && mthing->type < base + MAXPLAYERS - 4)
{ {
pnum = mthing->type - base + 4; pnum = mthing->type - gameinfo.player5start + 4;
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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