Merge pull request #7939 from bencie/fix-tpxy

Fix /tpxy parameter bug
This commit is contained in:
Dennis Felsing 2024-02-06 15:32:55 +00:00 committed by GitHub
commit 38be4b5745
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -1638,11 +1638,11 @@ void CGameContext::ConTeleXY(IConsole::IResult *pResult, void *pUserData)
// Relative?
const char *pStrDelta = str_startswith(pInString, "~");
if(!str_isallnum(pStrDelta ? pStrDelta : pInString))
float d;
if(!str_tofloat(pStrDelta ? pStrDelta : pInString, &d))
return false;
// Is the number valid?
float d = str_tofloat(pStrDelta ? pStrDelta : pInString);
if(std::isnan(d) || std::isinf(d))
return false;

View file

@ -3647,7 +3647,7 @@ void CGameContext::RegisterChatCommands()
Console()->Register("rescue", "", CFGFLAG_CHAT | CFGFLAG_SERVER, ConRescue, this, "Teleport yourself out of freeze (use sv_rescue 1 to enable this feature)");
Console()->Register("tp", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeleTo, this, "Depending on the number of supplied arguments, teleport yourself to; (0.) where you are spectating or aiming; (1.) the specified player name");
Console()->Register("teleport", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeleTo, this, "Depending on the number of supplied arguments, teleport yourself to; (0.) where you are spectating or aiming; (1.) the specified player name");
Console()->Register("tpxy", "i[x] i[y]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeleXY, this, "Teleport yourself to the specified coordinates");
Console()->Register("tpxy", "f[x] f[y]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeleXY, this, "Teleport yourself to the specified coordinates");
Console()->Register("lasttp", "", CFGFLAG_CHAT | CFGFLAG_SERVER, ConLastTele, this, "Teleport yourself to the last location you teleported to");
Console()->Register("tc", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeleCursor, this, "Teleport yourself to player or to where you are spectating/or looking if no player name is given");
Console()->Register("telecursor", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConTeleCursor, this, "Teleport yourself to player or to where you are spectating/or looking if no player name is given");