From 42e4a068bb1cd363c3ed308e10c2747a6035e2de Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 2 Jan 2021 11:38:54 +0200 Subject: CVarConsole --- src/core/Game.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/core/Game.cpp') diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 348ac26d..8405c2ec 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -96,6 +96,7 @@ #include "postfx.h" #include "custompipes.h" #include "screendroplets.h" +#include "VarConsole.h" #ifdef USE_TEXTURE_POOL #include "TexturePools.h" #endif @@ -113,6 +114,10 @@ char CGame::aDatFile[32]; bool CGame::russianGame = false; bool CGame::japaneseGame = false; #endif +#ifndef MASTER +CVector CGame::PlayerCoords; +bool8 CGame::VarUpdatePlayerCoords; +#endif int gameTxdSlot; @@ -557,6 +562,16 @@ bool CGame::Initialise(const char* datFile) #ifdef USE_TEXTURE_POOL _TexturePoolsUnknown(true); #endif + +#ifndef MASTER + PlayerCoords = FindPlayerCoors(); + VarConsole.Add("X PLAYER COORD", &PlayerCoords.x, 10.0f, -10000.0f, 10000.0f, true); + VarConsole.Add("Y PLAYER COORD", &PlayerCoords.y, 10.0f, -10000.0f, 10000.0f, true); + VarConsole.Add("Z PLAYER COORD", &PlayerCoords.z, 10.0f, -10000.0f, 10000.0f, true); + VarConsole.Add("UPDATE PLAYER COORD", &VarUpdatePlayerCoords, true); +#endif + + DMAudio.SetStartingTrackPositions(true); DMAudio.ChangeMusicMode(MUSICMODE_GAME); return true; @@ -837,6 +852,12 @@ void CGame::Process(void) CWindModifiers::Number = 0; if (!CTimer::GetIsPaused()) { +#ifndef MASTER + if (VarUpdatePlayerCoords) { + FindPlayerPed()->Teleport(PlayerCoords); + VarUpdatePlayerCoords = false; + } +#endif CSprite2d::SetRecipNearClip(); CSprite2d::InitPerFrame(); CFont::InitPerFrame(); -- cgit v1.2.3