Smelting Gives Experience (#4094)
* Smelting Exp Smelting now gives experience * Furnace.txt update Exp rewards are entered in furnace.txt, Reward calculation is now done is the furnaceentity class * furnace.txt update Changed alignment tabs to spaces Included documentation of exp in recipe * Updated StringToFloat changed strtod to strtof * Explicit Float to Int * Reworked Smelting Rewards * No C casts -Adds new function to the api -Sets reward counter to 0 in furnace constructor * Style and exp lock removed -Fixed style mistakes accoring to PR notes -XP isn't locked to a single player anymore * No Smelter API -Removed SetLastSmelter and GetLastSmelter -Fixed comments -Fixed log reward amounts
This commit is contained in:
committed by
Alexander Harkness
parent
1e312296cc
commit
a0896c63d7
@@ -1051,3 +1051,15 @@ AString StringsConcat(const AStringVector & a_Strings, char a_Separator)
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
bool StringToFloat(const AString & a_String, float & a_Num)
|
||||
{
|
||||
char *err;
|
||||
a_Num = strtof(a_String.c_str(), &err);
|
||||
if (*err != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user