mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #6710
6710: Use real instead of display string for number line inputs r=def- a=Robyt3 Set input string if it's not identical to the real input string instead of comparing to the display string, which would be incorrect for hidden number inputs. ## Checklist - [X] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
23e7d18b29
|
@ -677,7 +677,7 @@ void CLineInputNumber::SetInteger(int Number, int Base)
|
||||||
dbg_assert(false, "Base unsupported");
|
dbg_assert(false, "Base unsupported");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(str_comp(aBuf, GetDisplayedString()) != 0)
|
if(str_comp(aBuf, GetString()) != 0)
|
||||||
Set(aBuf);
|
Set(aBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -690,7 +690,7 @@ void CLineInputNumber::SetFloat(float Number)
|
||||||
{
|
{
|
||||||
char aBuf[32];
|
char aBuf[32];
|
||||||
str_format(aBuf, sizeof(aBuf), "%.3f", Number);
|
str_format(aBuf, sizeof(aBuf), "%.3f", Number);
|
||||||
if(str_comp(aBuf, GetDisplayedString()) != 0)
|
if(str_comp(aBuf, GetString()) != 0)
|
||||||
Set(aBuf);
|
Set(aBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue