X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=30a71f18306d98e7b0b79486399b0323284ee28d;hb=36fd4e713dc3cc0d54fd94085af17a77f5078e11;hp=2ec93df11d2f99501fa7ce1176c5076105436ad7;hpb=ab6584e462f432b3dd46a91f3a89cab35a0c7243;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 2ec93df..30a71f1 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -560,8 +560,8 @@ var gPlayerIndicator: Integer = 1; gPlayerIndicatorStyle: Integer = 0; gNumBots: Word = 0; - gLMSPID1: Word = 0; - gLMSPID2: Word = 0; + gSpectLatchPID1: Word = 0; + gSpectLatchPID2: Word = 0; MAX_RUNVEL: Integer = 8; VEL_JUMP: Integer = 10; SHELL_TIMEOUT: Cardinal = 60000; @@ -1072,12 +1072,6 @@ begin Break; end; -// Èìåíè íåò, çàäàåì ñëó÷àéíîå: - if _name = '' then - repeat - _name := Format('DFBOT%.2d', [Random(100)]); - until g_Player_ValidName(_name); - // Âûáèðàåì ñëó÷àéíóþ ìîäåëü: _model := m[Random(Length(m))]; @@ -1088,7 +1082,11 @@ begin Min(Random(9)*32, 255)), Team, True)) as TBot do begin - Name := _name; + // Åñëè èìåíè íåò, äåëàåì åãî èç UID áîòà + if _name = '' then + Name := Format('DFBOT%.5d', [UID]) + else + Name := _name; case Difficult of 1: FDifficult := DIFFICULT_EASY; @@ -2768,7 +2766,14 @@ begin e_CharFont_PrintEx(gMenuSmallFont, X-16-tw, Y+32, s, _RGB(255, 0, 0)); end; - if gShowLives and (gGameSettings.MaxLives > 0) then + if gLMSRespawn > LMS_RESPAWN_NONE then + begin + s := _lc[I_GAME_WARMUP]; + e_CharFont_GetSize(gMenuFont, s, tw, th); + s := s + ': ' + IntToStr((gLMSRespawnTime - gTime) div 1000); + e_CharFont_PrintEx(gMenuFont, X-64-tw, SY-32, s, _RGB(0, 255, 0)); + end + else if gShowLives and (gGameSettings.MaxLives > 0) then begin s := IntToStr(Lives); e_CharFont_GetSize(gMenuFont, s, tw, th); @@ -3662,7 +3667,7 @@ begin if srv and (OldLR = LMS_RESPAWN_NONE) and (gLMSRespawn > LMS_RESPAWN_NONE) then begin if NetMode = NET_SERVER then - MH_SEND_GameEvent(NET_EV_LMS_WARMUP, (gLMSRespawnTime - gTime) div 1000) + MH_SEND_GameEvent(NET_EV_LMS_WARMUP, gLMSRespawnTime - gTime) else g_Console_Add(Format(_lc[I_MSG_WARMUP_START], [(gLMSRespawnTime - gTime) div 1000]), True); end; @@ -4368,6 +4373,7 @@ begin FMonsterKills := 0; FDeath := 0; FSecrets := 0; + FSpawnInvul := 0; FReady := False; if FNoRespawn then begin @@ -4560,6 +4566,7 @@ begin FShellTimer := -1; FPain := 0; FLastHit := 0; + FSpawnInvul := 0; if not g_Game_IsServer then Exit; @@ -4706,9 +4713,9 @@ begin FSpectatePlayer := -1; FSpawned := True; - if (gPlayer1 = nil) and (gLMSPID1 = FUID) then + if (gPlayer1 = nil) and (gSpectLatchPID1 = FUID) then gPlayer1 := self; - if (gPlayer2 = nil) and (gLMSPID2 = FUID) then + if (gPlayer2 = nil) and (gSpectLatchPID2 = FUID) then gPlayer2 := self; if g_Game_IsNet then @@ -4745,12 +4752,12 @@ begin begin if Self = gPlayer1 then begin - gLMSPID1 := FUID; + gSpectLatchPID1 := FUID; gPlayer1 := nil; - end; - if Self = gPlayer2 then + end + else if Self = gPlayer2 then begin - gLMSPID2 := FUID; + gSpectLatchPID2 := FUID; gPlayer2 := nil; end; end; @@ -4827,7 +4834,7 @@ begin if FDirection = TDirection.D_LEFT then FAngle := ANGLE_LEFTDOWN else FAngle := ANGLE_RIGHTDOWN; - if FIncCam > -120.0 * g_dbg_scale then DecMin(FIncCam, 5, Integer(-120.0 * g_dbg_scale)); + if FIncCam > -120 then DecMin(FIncCam, 5, -120); end; procedure TPlayer.SeeUp(); @@ -4836,7 +4843,7 @@ begin if FDirection = TDirection.D_LEFT then FAngle := ANGLE_LEFTUP else FAngle := ANGLE_RIGHTUP; - if FIncCam < 120.0 * g_dbg_scale then IncMax(FIncCam, 5, Integer(120.0 * g_dbg_scale)); + if FIncCam < 120 then IncMax(FIncCam, 5, 120); end; procedure TPlayer.SetAction(Action: Byte; Force: Boolean = False); @@ -6303,6 +6310,7 @@ begin if FMegaRulez[MR_INVUL] < gTime+PLAYER_INVUL_TIME then begin FMegaRulez[MR_INVUL] := gTime+PLAYER_INVUL_TIME; + FSpawnInvul := 0; end; ITEM_INVIS: