From 200a44d8a165e3c687ffca7f695ea1dc84e0bc05 Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Sun, 26 Jan 2025 01:48:59 -0800 Subject: [PATCH] Remove references to m_sUrl; disable GetUrl with a warning; add a missing brace to IsZero() since we removed a URL variable from it --- src/GameCommand.cpp | 20 +++++++++++--------- src/GameCommand.h | 3 +-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index 25b12abc81..db5627de9b 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -60,7 +60,6 @@ void GameCommand::Init() m_iGoalCalories = -1; m_GoalType = GoalType_Invalid; m_sProfileID = ""; - m_sUrl = ""; m_bUrlExits = true; m_bInsertCredit = false; @@ -402,8 +401,7 @@ void GameCommand::LoadOne( const Command& cmd ) else if( sName == "url" ) { - m_sUrl = sValue; - m_bUrlExits = true; + // url usage has been deprecated. This block exists for backwards compatibility. } else if( sName == "sound" ) @@ -439,8 +437,7 @@ void GameCommand::LoadOne( const Command& cmd ) // sm-ssc additions begin: else if( sName == "urlnoexit" ) { - m_sUrl = sValue; - m_bUrlExits = false; + // url usage has been deprecated. This block exists for backwards compatibility. } else if( sName == "setpref" ) @@ -897,10 +894,11 @@ bool GameCommand::IsZero() const m_iWeightPounds != -1 || m_iGoalCalories != -1 || m_GoalType != GoalType_Invalid || - !m_sProfileID.empty() || - !m_sUrl.empty() ) + !m_sProfileID.empty() ) + { return false; - + } + return true; } @@ -927,7 +925,11 @@ public: static int GetTrail( T* p, lua_State *L ) { if(p->m_pTrail== nullptr) lua_pushnil(L); else p->m_pTrail->PushSelf(L); return 1; } static int GetCharacter( T* p, lua_State *L ) { if(p->m_pCharacter== nullptr) lua_pushnil(L); else p->m_pCharacter->PushSelf(L); return 1; } static int GetSongGroup( T* p, lua_State *L ) { lua_pushstring(L, p->m_sSongGroup ); return 1; } - static int GetUrl( T* p, lua_State *L ) { lua_pushstring(L, p->m_sUrl ); return 1; } + static int GetUrl(T* p, lua_State* L) + { + LOG->Warn("GetUrl usage has been deprecated."); + return 1; + } static int GetAnnouncer( T* p, lua_State *L ) { lua_pushstring(L, p->m_sAnnouncer ); return 1; } static int GetPreferredModifiers( T* p, lua_State *L ) { lua_pushstring(L, p->m_sPreferredModifiers ); return 1; } static int GetStageModifiers( T* p, lua_State *L ) { lua_pushstring(L, p->m_sStageModifiers ); return 1; } diff --git a/src/GameCommand.h b/src/GameCommand.h index 2f406f4bac..258854ab7b 100644 --- a/src/GameCommand.h +++ b/src/GameCommand.h @@ -41,7 +41,7 @@ public: m_sSongGroup(""), m_SortOrder(SortOrder_Invalid), m_sSoundPath(""), m_vsScreensToPrepare(), m_iWeightPounds(-1), m_iGoalCalories(-1), m_GoalType(GoalType_Invalid), - m_sProfileID(""), m_sUrl(""), m_bUrlExits(true), + m_sProfileID(""), m_bUrlExits(true), m_bInsertCredit(false), m_bClearCredits(false), m_bStopMusic(false), m_bApplyDefaultOptions(false), m_bFadeMusic(false), m_fMusicFadeOutVolume(-1), @@ -108,7 +108,6 @@ public: int m_iGoalCalories; // -1 == none specified GoalType m_GoalType; RString m_sProfileID; - RString m_sUrl; // sm-ssc adds: bool m_bUrlExits; // for making stepmania not exit on url