• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Players recieve double damage from other players

Status
Not open for further replies.

venius

Active Member
Joined
Dec 27, 2010
Messages
150
Reaction score
36
I have a weird bug where players attacking other players deal double damage. This is only the case for actual health change and NOT for mana change. So if I player hits another player with utamo vita then the damage is calculated properly. Any ideas? I modified something in "game.cpp" a while ago, maybe I messed it up there?

(TFS 1.5, 8.6 downgraded by Nekiro)
 
It could be an onHealthChange script, Do you have any of it?
 
Ig you should use
Rich (BB code):
combat:setOrigin(ORIGIN_WAND)
If you are using wand or smth i ran with this before as i remember.
 
Ig you should use
Rich (BB code):
combat:setOrigin(ORIGIN_WAND)
If you are using wand or smth i ran with this before as i remember.
It is not exclusive to wand damage, the wand was just to display the bug. All damage is doubled when attacking other players' HP
 
99% sure it is related to onHealthChange script you got, since no one else using nekiros downgrade reported this issue
I was implying that I changed something in sources that messed things up. It was definitely working before...
The only onHealthChange script I have is also paired with an OnManaChange script, so shouldn't both be bugged then? idk
 
Last edited:
in case it's something from the sources it's probably in the Game::combatChangeHealth function in game.cpp
if you leave a link to that file in your repository we can review it.
 
None of my characters are rebirthed

on Game::combatChangeHealth(...)

Look for:
C++:
std::cout << bonusRebirth << std::endl;

damage.primary.value = std::abs(damage.primary.value) * bonusRebirth;
damage.secondary.value = std::abs(damage.secondary.value) * bonusRebirth;

Replace with:
C++:
std::cout << bonusRebirth << std::endl;

std::clog << "raw-damage: " << std::abs(damage.primary.value) << " - " << std::abs(damage.secondary.value) << std::endl;

damage.primary.value = std::abs(damage.primary.value) * bonusRebirth;
damage.secondary.value = std::abs(damage.secondary.value) * bonusRebirth;

std::clog << "mod-damage: " << damage.primary.value << " - " << damage.secondary.value << std::endl;

Also add this, on here
C++:
std::clog << "damageStr: " << damage.primary.value << " - " << damage.secondary.value << std::endl;

Compile and do the same exact test again
 
on Game::combatChangeHealth(...)

Look for:
C++:
std::cout << bonusRebirth << std::endl;

damage.primary.value = std::abs(damage.primary.value) * bonusRebirth;
damage.secondary.value = std::abs(damage.secondary.value) * bonusRebirth;

Replace with:
C++:
std::cout << bonusRebirth << std::endl;

std::clog << "raw-damage: " << std::abs(damage.primary.value) << " - " << std::abs(damage.secondary.value) << std::endl;

damage.primary.value = std::abs(damage.primary.value) * bonusRebirth;
damage.secondary.value = std::abs(damage.secondary.value) * bonusRebirth;

std::clog << "mod-damage: " << damage.primary.value << " - " << damage.secondary.value << std::endl;

Also add this, on here
C++:
std::clog << "damageStr: " << damage.primary.value << " - " << damage.secondary.value << std::endl;

Compile and do the same exact test again
All of them print the same number, which is the number that should be there not the 2x value
 
All of them print the same number, which is the number that should be there not the 2x value
Taking your last gift as example, its printing 255~257 ?

@Sarah Wesker but code is not executed until the second call, since its returned as a bool
Edit: ah nvm, I was looking at the healing code instead damage but still im not sure if that could be the issue
 
Taking your last gift as example, its printing 255~257 ?

@Sarah Wesker but code is not executed until the second call, since its returned as a bool
Edit: ah nvm, I was looking at the healing code instead damage still im not sure if that could be the issue
Yeah, it is printing exactly that. I'm not sure either...
 
Status
Not open for further replies.
Back
Top