Fix scoreboard not updating relaunches #1947

install-platforms
Martin Strohmeier 2017-10-15 23:54:39 +02:00
parent b94c3757a6
commit a0b131cefd
2 changed files with 10 additions and 2 deletions

View File

@ -38,6 +38,14 @@ protected func RelaunchPlayer(int plr, int killer)
return _inherited(plr, killer, ...);
}
protected func OnPlayerRelaunch(int plr)
{
if (GetRelaunchRule()->HasUnlimitedRelaunches()) return;
Scoreboard->SetPlayerData(plr, "relaunches", GetRelaunchRule()->GetPlayerRelaunchCount(plr));
return _inherited(plr, ...);
}
protected func RemovePlayer(int plr)
{
return _inherited(plr, ...);

View File

@ -220,7 +220,7 @@ public func InitializePlayer(int plr)
if (!initial_relaunch || !perform_restart)
return;
// Scenario script callback.
if (GameCall("OnPlayerRelaunch", plr, false))
if (GameCallEx("OnPlayerRelaunch", plr, false))
return;
return DoRelaunch(plr, nil, nil, true);
}
@ -241,7 +241,7 @@ public func OnClonkDeath(object clonk, int killer)
return;
}
}
if (GameCall("OnPlayerRelaunch", plr, true))
if (GameCallEx("OnPlayerRelaunch", plr, true))
return;
return DoRelaunch(plr, clonk, nil);
}