New botcode works now
This commit is contained in:
parent
553676e588
commit
464f9464e9
6 changed files with 26 additions and 20 deletions
|
|
@ -3591,25 +3591,14 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
node = (UINT8)READUINT8(*p);
|
||||
newplayernum = (UINT8)READUINT8(*p);
|
||||
|
||||
CONS_Debug(DBG_NETPLAY, "addplayer: %d %d\n", node, newplayernum);
|
||||
|
||||
{
|
||||
// Clear player before joining, lest some things get set incorrectly
|
||||
CL_ClearPlayer(newplayernum);
|
||||
|
||||
playeringame[newplayernum] = true;
|
||||
G_AddPlayer(newplayernum);
|
||||
|
||||
if (newplayernum+1 > doomcom->numslots)
|
||||
doomcom->numslots = (INT16)(newplayernum+1);
|
||||
}
|
||||
|
||||
newplayer = &players[newplayernum];
|
||||
|
||||
newplayer->jointime = 0;
|
||||
|
||||
READSTRINGN(*p, player_names[newplayernum], MAXPLAYERNAME);
|
||||
|
||||
G_AddPlayer(newplayernum, console);
|
||||
|
||||
console = (UINT8)READUINT8(*p);
|
||||
splitscreenplayer = (UINT8)READUINT8(*p);
|
||||
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ void G_ReadDemoExtraData(void)
|
|||
{
|
||||
CL_ClearPlayer(p);
|
||||
playeringame[p] = true;
|
||||
G_AddPlayer(p);
|
||||
G_AddPlayer(p, p);
|
||||
players[p].spectator = true;
|
||||
//CONS_Printf("player %s is joining server on tic %d\n", player_names[p], leveltime);
|
||||
}
|
||||
|
|
|
|||
17
src/g_game.c
17
src/g_game.c
|
|
@ -2960,10 +2960,21 @@ void G_DoReborn(INT32 playernum)
|
|||
ACS_RunPlayerEnterScript(player);
|
||||
}
|
||||
|
||||
void G_AddPlayer(INT32 playernum)
|
||||
void G_AddPlayer(INT32 playernum, INT32 console)
|
||||
{
|
||||
player_t *p = &players[playernum];
|
||||
p->playerstate = PST_REBORN;
|
||||
CL_ClearPlayer(playernum);
|
||||
//G_DestroyParty(playernum);
|
||||
|
||||
playeringame[playernum] = true;
|
||||
|
||||
playerconsole[playernum] = console;
|
||||
//G_BuildLocalSplitscreenParty(playernum);
|
||||
|
||||
player_t *newplayer = &players[playernum];
|
||||
|
||||
newplayer->playerstate = PST_REBORN;
|
||||
newplayer->jointime = 0;
|
||||
|
||||
demo_extradata[playernum] |= DXD_PLAYSTATE|DXD_COLOR|DXD_NAME|DXD_SKIN|DXD_FOLLOWER; // Set everything
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ void G_AddPartyMember (INT32 party_member, INT32 new_party_member);
|
|||
void G_RemovePartyMember (INT32 party_member);
|
||||
void G_ResetSplitscreen (INT32 playernum);
|
||||
|
||||
void G_AddPlayer(INT32 playernum);
|
||||
void G_AddPlayer(INT32 playernum, INT32 console);
|
||||
|
||||
void G_SetExitGameFlag(void);
|
||||
void G_ClearExitGameFlag(void);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ void K_SetBot(UINT8 newplayernum, UINT8 skinnum, UINT8 difficulty, botStyle_e st
|
|||
{
|
||||
CONS_Debug(DBG_NETPLAY, "addbot: %d\n", newplayernum);
|
||||
|
||||
G_AddPlayer(newplayernum);
|
||||
G_AddPlayer(newplayernum, newplayernum);
|
||||
|
||||
if (newplayernum+1 > doomcom->numslots)
|
||||
doomcom->numslots = (INT16)(newplayernum+1);
|
||||
|
|
@ -325,7 +325,7 @@ void K_UpdateMatchRaceBots(void)
|
|||
grabskins[index] = grabskins[--usableskins];
|
||||
}
|
||||
|
||||
if (!K_AddBot(0, difficulty, BOT_STYLE_NORMAL, &newplayernum))
|
||||
if (!K_AddBot(skinnum, difficulty, BOT_STYLE_NORMAL, &newplayernum))
|
||||
{
|
||||
// Not enough player slots to add the bot, break the loop.
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3302,6 +3302,12 @@ static void K_GetKartBoostPower(player_t *player)
|
|||
ADDBOOST(FRACUNIT/5, 4*FRACUNIT); // + 20% top speed, + 400% acceleration
|
||||
}
|
||||
|
||||
// This should always remain the last boost stack before tethering
|
||||
if (player->botvars.rubberband > FRACUNIT && K_PlayerUsesBotMovement(player) == true)
|
||||
{
|
||||
ADDBOOST(player->botvars.rubberband - FRACUNIT, 0);
|
||||
}
|
||||
|
||||
player->boostpower = boostpower;
|
||||
|
||||
// value smoothing
|
||||
|
|
|
|||
Loading…
Reference in a new issue