First off, if this is posted on wrong place, please put it on the right place since I got some other codes coming and I want to be on the right spot.
What is this code?
It is a fix in the creature.cpp where if you had a summon and killed a monster you wouldn't get the exp rate in the stages.xml, but in the confing.lua
I'm just changing one line so I can't give myself any credits to this, just a small change in the TFS stages version.
Start of the code:
creature.cpp
Change...
...to
End of the code:
And there you go
I didn't want to change
into
inside player.h and creature.h because I rather keep it as it is since it works. If any of the 1337P) programmers can tell if its ok to change that too or not, since then I could change this too:
Please leave a comment
Yours,
Kadj
What is this code?
It is a fix in the creature.cpp where if you had a summon and killed a monster you wouldn't get the exp rate in the stages.xml, but in the confing.lua
I'm just changing one line so I can't give myself any credits to this, just a small change in the TFS stages version.
Start of the code:
creature.cpp
Change...
Code:
uint64_t lostExperience = getLostExperience();
return attacker->getPlayer() ? ((uint64_t)std::floor(getDamageRatio(attacker) * lostExperience * g_game.getExperienceStage(attacker->getPlayer()->getLevel()))) : ((uint64_t)std::floor(getDamageRatio(attacker) * lostExperience * g_config.getNumber(ConfigManager::RATE_EXPERIENCE)));
...to
Code:
int64_t lostExperience = getLostExperience();
Player* player = attacker->getPlayer();
if(!player){
player = attacker->getMaster()->getPlayer();
}
if(player){
return (int64_t)std::floor(getDamageRatio(attacker) * lostExperience * g_game.getExperienceStage(player->getLevel()));
}
And there you go
I didn't want to change
Code:
virtual uint64_t getGainedExperience(Creature* attacker) const;
into
Code:
virtual int64_t getGainedExperience(Creature* attacker) const;
inside player.h and creature.h because I rather keep it as it is since it works. If any of the 1337P) programmers can tell if its ok to change that too or not, since then I could change this too:
Code:
uint64_t Creature::getGainedExperience(Creature* attacker) const
Please leave a comment
Yours,
Kadj
Last edited: