roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 200
Hi, I noticed that in tfs 1.3 there is a bug, stages.xml does not support dotted exp stages.
for exemple, if player is in stage (201 to 300) and i print
it print 0, because have a dot in multiplier (2.5)
if i put multiplier value 2 or 3 it print correct....
I triedto change
uint32_t to float here:
game.cpp
and
game.h
and
but with this new configurations (float) it print.
if stage is 3.7 -> return 3
if stage is 1.5 -> return 1
if stage is 0.8 -> return 0
it seems to round down
what was left to do?
Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
<config enabled="1" />
<stage minlevel="1" maxlevel="10" multiplier="10"/>
<stage minlevel="101" maxlevel="200" multiplier="5"/>
<stage minlevel="201" maxlevel="300" multiplier="2.5"/>
<stage minlevel="301" maxlevel="400" multiplier="1.5"/>
<stage minlevel="401" maxlevel="500" multiplier="1"/>
<stage minlevel="501" multiplier="0.5"/>
</stages>
Code:
Game.getExperienceStage(self:getLevel())
if i put multiplier value 2 or 3 it print correct....
I triedto change
uint32_t to float here:
game.cpp
C++:
multiplier = pugi::cast<float>(multiplierAttribute.value());
C++:
float Game::getExperienceStage(uint32_t level)
game.h
C++:
std::map<uint32_t, float> stages;
C++:
float getExperienceStage(uint32_t level);
if stage is 3.7 -> return 3
if stage is 1.5 -> return 1
if stage is 0.8 -> return 0
it seems to round down
what was left to do?