Update game.cpp

master
chmodsayshello 2022-09-17 19:32:07 +02:00 committed by GitHub
parent 43fba1bf94
commit e1137a75b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -71,6 +71,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "version.h"
#include "script/scripting_client.h"
#include "hud.h"
#include "client/render/death.h"
bool died;
v3f dpos;
#if USE_SOUND
#include "client/sound_openal.h"
@ -1902,6 +1906,10 @@ void Game::handleClientEvent_Deathscreen(ClientEvent *event, CameraOrientation *
{
// If client scripting is enabled, deathscreen is handled by CSM code in
// builtin/client/init.lua
died = true;
dpos = client->getEnv().getLocalPlayer()->getPosition();
if (client->modsLoaded())
client->getScript()->on_death();
else