From 2c11fedfb041fa9eda6f1546f361c93e67005f26 Mon Sep 17 00:00:00 2001 From: Kyle Bradley Date: Tue, 2 Mar 2021 16:35:29 +0200 Subject: [PATCH] - Added name to message - Fixed format issue --- src/game/ddracechat.h | 2 ++ src/game/server/ddracechat.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/ddracechat.h b/src/game/ddracechat.h index 2cc4790e1..b1708e34c 100644 --- a/src/game/ddracechat.h +++ b/src/game/ddracechat.h @@ -31,8 +31,10 @@ CHAT_COMMAND("swap", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConSwap, CHAT_COMMAND("save", "?r[code]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConSave, this, "Save team with code r.") CHAT_COMMAND("load", "?r[code]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConLoad, this, "Load with code r. /load to check your existing saves") CHAT_COMMAND("map", "?r[map]", CFGFLAG_CHAT | CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, ConMap, this, "Vote a map by name") + CHAT_COMMAND("rankteam", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeamRank, this, "Shows the team rank of player with name r (your team rank by default)") CHAT_COMMAND("teamrank", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeamRank, this, "Shows the team rank of player with name r (your team rank by default)") + CHAT_COMMAND("rank", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConRank, this, "Shows the rank of player with name r (your rank by default)") CHAT_COMMAND("top5team", "?s[player name] ?i[rank to start with]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeamTop5, this, "Shows five team ranks of the ladder or of a player beginning with rank i (1 by default, -1 for worst)") CHAT_COMMAND("teamtop5", "?s[player name] ?i[rank to start with]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeamTop5, this, "Shows five team ranks of the ladder or of a player beginning with rank i (1 by default, -1 for worst)") diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 212a77fff..a2215ffc2 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -732,8 +732,8 @@ void CGameContext::ConSwap(IConsole::IResult *pResult, void *pUserData) return; } - CPlayer *pSwapPlayer = pSelf->m_apPlayers[TargetClientId]; - + CPlayer *pSwapPlayer = pSelf->m_apPlayers[TargetClientId]; + bool SwapPending = pSwapPlayer->m_ClientSwapID != pResult->m_ClientID; if(SwapPending) { @@ -741,7 +741,7 @@ void CGameContext::ConSwap(IConsole::IResult *pResult, void *pUserData) pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "swap", "Swap request sent. The player needs to confirm it."); char aBuf[512]; - str_format(aBuf, sizeof(aBuf), "'%s' has requested to swap positions with you. Type /swap to confirm the swap.", pSelf->Server()->ClientName(pResult->m_ClientID)); + str_format(aBuf, sizeof(aBuf), "'%s' has requested to swap positions with you. Type /swap %s to confirm the swap.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(TargetClientId, aBuf); return;