mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Fixed a bug with /tpxy where the parameters didn't take floats or negative numbers
This commit is contained in:
parent
5186175f24
commit
5b2c35dc36
|
@ -1638,11 +1638,11 @@ void CGameContext::ConTeleXY(IConsole::IResult *pResult, void *pUserData)
|
||||||
// Relative?
|
// Relative?
|
||||||
const char *pStrDelta = str_startswith(pInString, "~");
|
const char *pStrDelta = str_startswith(pInString, "~");
|
||||||
|
|
||||||
if(!str_isallnum(pStrDelta ? pStrDelta : pInString))
|
float d;
|
||||||
|
if(!str_tofloat(pStrDelta ? pStrDelta : pInString,&d))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Is the number valid?
|
// Is the number valid?
|
||||||
float d = str_tofloat(pStrDelta ? pStrDelta : pInString);
|
|
||||||
if(std::isnan(d) || std::isinf(d))
|
if(std::isnan(d) || std::isinf(d))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue