mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-20 23:24:16 +00:00
Fix change perspective in replays
Fixes change perspective features of multiplayer replays following cheat protection in023527e56e. Fixes: #8020 (cherry picked from commit67eaa8f1a9) Signed-off-by: Itms <itms@wildfiregames.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -76,7 +76,7 @@ void SetPlayerID(const ScriptRequest& rq, int id)
|
||||
if (currentID == id)
|
||||
return;
|
||||
|
||||
if (g_Game->CheatsEnabled())
|
||||
if (g_Game->CheatsEnabled() || g_Game->IsVisualReplay())
|
||||
g_Game->SetPlayerID(id);
|
||||
else
|
||||
ScriptException::Raise(rq, "Changing player ID with cheats disabled is prohibited");
|
||||
@@ -89,7 +89,7 @@ void SetViewedPlayer(const ScriptRequest& rq, int id)
|
||||
|
||||
int playerID = g_Game->GetPlayerID();
|
||||
// Forbid active players to reveal the map by changing perspective, unless cheats are allowed.
|
||||
if (playerID == -1 || g_Game->CheatsEnabled() || g_Game->PlayerFinished(playerID))
|
||||
if (playerID == -1 || g_Game->CheatsEnabled() || g_Game->PlayerFinished(playerID) || g_Game->IsVisualReplay())
|
||||
g_Game->SetViewedPlayerID(id);
|
||||
else
|
||||
ScriptException::Raise(rq, "Changing the perspective with cheats disabled is prohibited");
|
||||
|
||||
Reference in New Issue
Block a user