Skip to content

Commit

Permalink
Merge pull request #251 from mirko911/master
Browse files Browse the repository at this point in the history
Fixes bug in the GScr_Float function were negative float strings weren't converted to float
  • Loading branch information
T-Maxxx committed Jun 18, 2018
2 parents f577dbb + 8bffea3 commit bd70805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scr_vm_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -3346,7 +3346,7 @@ void GScr_Float()
{
char* strFloat = Scr_GetString(0);
double result = 0.0;
if (isdigit(strFloat[0]))
if ( isdigit(strFloat[0]) || (strFloat[0] == '-' && isdigit(strFloat[1])))
result = atof(strFloat);
Scr_AddFloat((float)result);
}
Expand Down

0 comments on commit bd70805

Please sign in to comment.