BUG: char(hp,regen)

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

BUG: char(hp,regen)

Post by Teh_ish » Sun Nov 09, 2003 4:34 pm

$char(hp,regen) pumping out -430ish value in between ticks, w/ latest irc-latest.zip
Last edited by Teh_ish on Mon Nov 10, 2003 12:52 am, edited 3 times in total.
OMGWTFBBQ

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sun Nov 09, 2003 4:37 pm

Code: Select all

	if (LastHealth && pChar->HPCurrent>LastHealth)
	{
		if (pChar->HPCurrent!=pChar->HPMax)
		{ // gained health, and not max
			HealthGained=pChar->HPCurrent-LastHealth;
		}
	}
	LastHealth=pChar->HPCurrent;
HealthGained (which is $char(hp,regen)) should never be negative. It's only set when current HPs are more than they were. If you can determine what's wrong I'll give you a cookie :)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Sun Nov 09, 2003 4:58 pm

It's only showing positive now..

I'm gonna throw out a guess, haven't confirmed yet but.. I think 433(value i'm getting regularly between ticks) is roughly the amount of +hp gear I've got on at the moment.

I'm back at negative after failing a mend.. Hrm..

I'm an iksar, curretnly get 4 regen per tick.

Numbers go like this:
-437, -433, -429, 4, repeat.
I just pased 433 hp and now it's:
4, half the tick, 433, half the tick, repeat.
OMGWTFBBQ

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Sun Nov 09, 2003 5:34 pm

Culprit Found: My +HP gear amounts to +433 hp. When I am below 433 hp it goes negative.
OMGWTFBBQ

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Nov 10, 2003 12:50 am

Hmm I see. I'll have to look into this and see whats going on.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Mon Nov 10, 2003 12:52 am

Lax wrote:Hmm I see. I'll have to look into this and see whats going on.
Great. I've confirmed, the number goes up in accordance to the +hp going up. Stays exactly the same.

Sorry to bug ya about it ;)
OMGWTFBBQ

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Mon Nov 10, 2003 7:56 pm

Ok, well I've looked at this and here's my thoughts:

It's pulling HPMax from the Spawninfo struct, which is not the character and thus I suspect that it does not include +hp items. As to how to fix this, I really don't know. Could make a function for GetMaxHP and cycle through a char's eq and pull out the +hp value.. Might be better just to add EQADDR_MAXHP if someone can find it in the offsets.
OMGWTFBBQ

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Nov 10, 2003 8:55 pm

Well, you'd be right except you're not :P I'll get it fixed sit tight.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Teh_ish
UI Guru
Posts: 168
Joined: Wed Nov 05, 2003 12:18 am

Post by Teh_ish » Mon Nov 10, 2003 9:14 pm

Be sure to give a good explanation of what's borked/how to fix it. Trying to learn how all this stuff works ;)
OMGWTFBBQ

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Nov 11, 2003 3:16 am

Well, looking into the problem. It appears as though we catch it in the middle of updating hit points. I'm adding calls to the EQ_Character::Max_HP and Cur_HP functions ;) There's a different way to get it using a global variable from EQ, but that relies on a specific label being used and we can't guarantee that. Anyway, solving this now.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Nov 11, 2003 3:58 am

Zip updated, this works correctly all the time now.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0