Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2016-08-04 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog

Author Topic: MaxHP bug  (Read 639 times)

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
MaxHP bug
« on: December 09, 2015, 09:55:31 PM »
Hi guys,

With some races that have a higher MaxHP, occasionally they will spawn with the maximum HP, instead of the standard spawn HP.

To explain further, a race Boyscout.  This is designed to spawn on 100HP, but through the use of ultimate, you can increase the health (up to a maximum of 250).

Lately, we've been seeing this race spawn with the 250 health, rather than the 100.

It's not just this race though, it appears to be any race that has a higher MaxHP than standard spawn amount can potentially be spawned with their max HP.

Just want to know if anyone else has come across this issue?  Or is there a fix in the pipeline for it?

Cheers :)

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2428
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: MaxHP bug
« Reply #1 on: December 09, 2015, 10:21:42 PM »
maybe the race itself is leaking the max hp buff?

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: MaxHP bug
« Reply #2 on: December 09, 2015, 10:28:43 PM »
Could you post the Scout race for us to see? If it is private you can send it to me in a PM.

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: MaxHP bug
« Reply #3 on: December 09, 2015, 11:46:27 PM »
I don't actually have the coding sorry - asking on behalf of the server admins.

Although i'm lead to believe it's to do with using the buff - iAdditionalMaxHealthNoHPChange.  Where this should spawn with normal health, but with the ability to heal (for instance) up to the MaxHP, however it's actually (and sporadically, so not every time) spawning with the MaxHP amount.

I don't think it's race specific, as we've identified at least 6 different races that all do the same thing, but again, only sporadically. 

Sorry to be vague here - i'll have a chat to the server admin and link him to this post, so he can more insight if required.

Cheers :)

Kibbles

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: MaxHP bug
« Reply #4 on: December 10, 2015, 12:47:24 AM »
The race is a modified version of the original Boy Scout written by xDr.HaaaaaaaXx, and while I don't know if our senior dev wants the source released, this is every call to a HP buff or heal shown in context:

Code: [Select]
public InitPassiveSkills( client )
{
    //Called when race is changed to, skill level is changed, or race spawns
    if( War3_GetRace( client ) == thisRaceID )
    {           
        ...
       
        War3_SetBuff(client, iAdditionalMaxHealthNoHPChange, thisRaceID, bsmaximumHP);
       
        ...
    }
}

public OnUltimateCommand( client, race, bool:pressed )
{
    if( race == thisRaceID && pressed && IsPlayerAlive( client ) && !Silenced( client ) )
    {
        new ult_level = War3_GetSkillLevel( client, race, ULT_AID );
        if( ult_level > 0 )
        {
            if( War3_SkillNotInCooldown( client, thisRaceID, ULT_AID, true ) )
            {
                ...
           
                War3_HealToMaxHP(client, HP[ult_level]);
               
                ...
            }
        }
        else
        {
            W3MsgUltNotLeveled( client );
        }
    }
}

There's a similar trend in the other affected races on our server. I'll be checking every race on our server which uses the NoHPChange buff soon to see if it's one of them, but since I'm not aware of a pattern to the occurrences it's difficult to tell if it's our plugins or the core. That's why we want to see if anyone else has been experiencing a similar issue to get a better idea of where to look for the problem :)

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: MaxHP bug
« Reply #5 on: December 10, 2015, 11:34:13 AM »
To be specific is this a matter of players using this race, then a new round starts and they have extra HP or actually dying and fully respawning? I'll take a once over of the MaxHP buffs but the more specific information I have the easier that'll be.

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2428
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: MaxHP bug
« Reply #6 on: December 10, 2015, 05:08:11 PM »
iAdditionalMaxHealthNoHPChange so they shouldn't spawn with maxed out health

your code doesn't show where it resets the buff if player changes race or leaves, and is InitPassiveSkills always called, and is skill level check always used?

or just unload the race and see if this happens without the race

Kibbles

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: MaxHP bug
« Reply #7 on: December 11, 2015, 05:24:15 PM »
The key element is that it only affects players with the NoHPChange buff. Some of the races reset buffs, some don't, though the Init functions are consistently called on spawn/race change. Because of these inconsistencies I've thought it's likely to be a bug with the mod, however I'm just about to check through every plugin we have with a heal to see if the issue is in one of them.

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Seven Sins Gaming
Re: MaxHP bug
« Reply #8 on: December 14, 2015, 04:54:49 PM »
The race is a modified version of the original Boy Scout written by xDr.HaaaaaaaXx, and while I don't know if our senior dev wants the source released, this is every call to a HP buff or heal shown in context:

Code: [Select]
public InitPassiveSkills( client )
{
    //Called when race is changed to, skill level is changed, or race spawns
    if( War3_GetRace( client ) == thisRaceID )
    {           
        ...
       
        War3_SetBuff(client, iAdditionalMaxHealthNoHPChange, thisRaceID, bsmaximumHP);
       
        ...
    }
}

public OnUltimateCommand( client, race, bool:pressed )
{
    if( race == thisRaceID && pressed && IsPlayerAlive( client ) && !Silenced( client ) )
    {
        new ult_level = War3_GetSkillLevel( client, race, ULT_AID );
        if( ult_level > 0 )
        {
            if( War3_SkillNotInCooldown( client, thisRaceID, ULT_AID, true ) )
            {
                ...
           
                War3_HealToMaxHP(client, HP[ult_level]);
               
                ...
            }
        }
        else
        {
            W3MsgUltNotLeveled( client );
        }
    }
}

There's a similar trend in the other affected races on our server. I'll be checking every race on our server which uses the NoHPChange buff soon to see if it's one of them, but since I'm not aware of a pattern to the occurrences it's difficult to tell if it's our plugins or the core. That's why we want to see if anyone else has been experiencing a similar issue to get a better idea of where to look for the problem :)

I don't mind if you need to post up our full source for boyscout.  Dr Haaax might though :D
STEAM PROFILE

NEW CS:GO SERVER:

Revan

  • Hero Member
  • *****
  • Posts: 503
    • View Profile
Re: MaxHP bug
« Reply #9 on: December 15, 2015, 09:42:27 AM »
I don't mind if you need to post up our full source for boyscout.  Dr Haaax might though :D

You can get Boy Scout here
#war3source on gamesurge

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Seven Sins Gaming
Re: MaxHP bug
« Reply #10 on: December 15, 2015, 03:30:10 PM »
I don't mind if you need to post up our full source for boyscout.  Dr Haaax might though :D

You can get Boy Scout here

Kibbs was referring to our modified version :)

You're right though, since boyscout is public, I don't see it being a problem to share ours.
STEAM PROFILE

NEW CS:GO SERVER:

Kibbles

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: MaxHP bug
« Reply #11 on: December 21, 2015, 11:27:57 PM »
After some research, it looks like the bug is likely to be due to a plugin on our server bugging. If it turns out to be the core war3source modules I'll submit a fix later!