Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status_calc_regen_rate_pc (NULLPO) #2973

Open
tlacson7 opened this issue Apr 7, 2021 · 7 comments
Open

status_calc_regen_rate_pc (NULLPO) #2973

tlacson7 opened this issue Apr 7, 2021 · 7 comments

Comments

@tlacson7
Copy link

tlacson7 commented Apr 7, 2021

Describe the bug
this triggers
[Error]: --- nullpo info -------------------------------------------- [Error]: status.c:3229: 'regen->sitting' in function status_calc_regen_pc'
[Error]: 0x63cdc6 nullpo_backtrace_print
[Error]: /home/test/me/src/common/nullpo.c:77
[Error]: 0x63cdc6 assert_report
[Error]: /home/test/me/src/common/nullpo.c:147
[Error]: 0x621844 status_calc_regen
[Error]: /home/test/me/src/map/status.c:3420
[Error]: 0x52b839 pc_setpos
[Error]: /home/test/me/src/map/pc.c:6054
[Error]: 0x51fa8d pc_authok
[Error]: /home/test/rme/src/map/pc.c:1319
[Error]: 0x7f9f23232e99 HP_pc_authok
[Error]: HPMHooking/HPMHooking_map.Hooks.inc:61677
[Error]: 0x454204 chrif_authok
[Error]: /home/test/me/src/map/chrif.c:828
[Error]: 0x459850 chrif_parse
[Error]: /home/test/me/src/map/chrif.c:1669
[Error]: 0x64f7cd do_sockets
[Error]: /home/test/me/src/common/socket.c:1474
[Error]: 0x408af1 main
[Error]: /home/test/me/src/common/core.c:539
[Error]: 0x7f9f257b3554 ???
[Error]: ???:0
[Error]: 0x408cb2 ???
[Error]: ???:0
[Error]: 0xffffffffffffffff ???
[Error]: ???:0
[Error]: --- end nullpo info ----------------------------------------
`

To Reproduce
Steps to reproduce the behavior:

  1. using your GM account go to guild map.
  2. save on that map
  3. Relogin.

System specs (please complete the following information):

  • OS: [Centos 7x64]
  • Hercules Version [latest]
  • Mode: [pre-renewal]
  • Packet version: [20151029]
  • Client type: [main]
@skyleo
Copy link
Contributor

skyleo commented Apr 7, 2021

What's a guild map? Can you give an example?

@tlacson7
Copy link
Author

tlacson7 commented Apr 7, 2021

woe castles like payg_cas02

@skyleo
Copy link
Contributor

skyleo commented Apr 8, 2021

Can you describe more what class you used? and what skills you had?
Also was a Mercenary, Homunculus or anything of the sort out?

@skyleo
Copy link
Contributor

skyleo commented Apr 8, 2021

Are you sure you have the latest version of Hercules?
Can you give us the code of status_calc_regen that you have?

@tlacson7
Copy link
Author

tlacson7 commented Apr 8, 2021

`
static void status_calc_regen_pc(struct map_session_data *sd, struct status_data *st, struct regen_data *regen)
{
nullpo_retv(sd);
nullpo_retv(st);
nullpo_retv(regen);
nullpo_retv(regen->sitting);
nullpo_retv(regen->skill);

struct status_change *sc = &sd->sc;

if ((sc->data[SC_POISON] != NULL && sc->data[SC_SLOWPOISON] == NULL)
	|| (sc->data[SC_DPOISON] != NULL && sc->data[SC_SLOWPOISON] == NULL)
	|| sc->data[SC_BERSERK] != NULL
	|| sc->data[SC_TRICKDEAD] != NULL
	|| sc->data[SC_BLOODING] != NULL
	|| sc->data[SC_MAGICMUSHROOM] != NULL
	|| sc->data[SC_RAISINGDRAGON] != NULL
	|| sc->data[SC_SATURDAY_NIGHT_FEVER] != NULL
	) {
	regen->flag = 0;
	return; // Don't bother going on as no regen under those status.
}

if (sc->data[SC_DANCING] != NULL
	|| sc->data[SC_OBLIVIONCURSE] != NULL
	|| sc->data[SC_MAXIMIZEPOWER] != NULL
	|| sc->data[SC_REBOUND] != NULL
	|| sc->data[SC_VITALITYACTIVATION] != NULL
	|| ((sd->job & MAPID_UPPERMASK) == MAPID_MONK
		&& (sc->data[SC_EXTREMITYFIST] != NULL
			|| (sc->data[SC_EXPLOSIONSPIRITS] != NULL
				&& (sc->data[SC_SOULLINK] == NULL || sc->data[SC_SOULLINK]->val2 != SL_MONK)
				)
			)
		)
	) {
	regen->flag &= ~RGN_SP; //No natural SP regen
}

if (sc->data[SC_GDSKILL_REGENERATION] != NULL && sc->data[SC_GDSKILL_REGENERATION]->val4 != 0) {
		regen->flag &= ~sc->data[SC_GDSKILL_REGENERATION]->val4; //Remove regen as specified by val4
}

// Base HP/SP restore values formual
regen->hp = 1 + (st->vit / 5) + (st->max_hp / 200);
regen->sp = 1 + (st->int_ / 6) + (st->max_sp / 100);
if (st->int_ >= 120)
	regen->sp += ((st->int_ - 120) / 2) + 4;

// Modifiers applied to base SP/HP restore values
if (sd->hprecov_rate != 100)
	regen->hp = regen->hp * sd->hprecov_rate / 100;

if (sd->sprecov_rate != 100)
	regen->sp = regen->sp * sd->sprecov_rate / 100;

// Base natural HP/SP restore bonuses
int skill_lv;

if ((skill_lv = pc->checkskill(sd, HP_MEDITATIO)) > 0)
	regen->sp = regen->sp * (100 + 3 * skill_lv) / 100;

if (sc->data[SC_GENTLETOUCH_REVITALIZE] != NULL)
	regen->hp += regen->hp * (30 * sc->data[SC_GENTLETOUCH_REVITALIZE]->val1 + 50) / 100;

// Recovery Items
if (sc->data[SC_EXTRACT_WHITE_POTION_Z] != NULL)
	regen->hp += regen->hp * sc->data[SC_EXTRACT_WHITE_POTION_Z]->val1 / 100;
if (sc->data[SC_VITATA_500] != NULL)
	regen->sp += regen->sp * sc->data[SC_VITATA_500]->val1 / 100;
if (sc->data[SC_ATKER_ASPD] != NULL)
	regen->hp += regen->hp * sc->data[SC_ATKER_ASPD]->val2 / 100;
if (sc->data[SC_ATKER_MOVESPEED] != NULL)
	regen->sp += regen->sp * sc->data[SC_ATKER_MOVESPEED]->val2 / 100;
if (sc->data[SC_BUCHEDENOEL] != NULL) {
	regen->hp += regen->hp * sc->data[SC_BUCHEDENOEL]->val1 / 100;
	regen->sp += regen->sp * sc->data[SC_BUCHEDENOEL]->val2 / 100;
}

// Skill HP/SP restore bonuses
struct regen_data_sub *skill_regen = regen->skill;
skill_regen->hp = 0;
skill_regen->sp = 0;

if ((skill_lv = pc->checkskill(sd, SM_RECOVERY)) > 0)
	skill_regen->hp += skill_lv * 5 + skill_lv * st->max_hp / 500;

if ((skill_lv = pc->checkskill(sd, MG_SRECOVERY)) > 0)
	skill_regen->sp += skill_lv * 3 + skill_lv * st->max_sp / 500;
if ((skill_lv = pc->checkskill(sd, NJ_NINPOU)) > 0)
	skill_regen->sp += skill_lv * 3 + skill_lv * st->max_sp / 500;
if ((skill_lv = pc->checkskill(sd, WM_LESSON)) > 0)
	skill_regen->sp += skill_lv * 3 + skill_lv * st->max_sp / 500;

// Skill HP/SP during sitting bonuses
struct regen_data_sub *sitting_regen = regen->sitting;
sitting_regen->hp = 0;
sitting_regen->sp = 0;

if ((skill_lv = pc->checkskill(sd, MO_SPIRITSRECOVERY)) > 0)
	sitting_regen->hp += skill_lv * 4 + skill_lv * st->max_hp / 500;

if ((skill_lv = pc->checkskill(sd, TK_HPTIME)) > 0 && sd->state.rest != 0)
	sitting_regen->hp += skill_lv * 30 + skill_lv * st->max_hp / 500;

if ((skill_lv = pc->checkskill(sd, TK_SPTIME)) > 0 && sd->state.rest != 0) {
	sitting_regen->sp += skill_lv * 3 + skill_lv * st->max_sp / 500;
	if ((skill_lv = pc->checkskill(sd, SL_KAINA)) > 0) //Power up Enjoyable Rest
		sitting_regen->sp += sitting_regen->sp * (30 + 10 * skill_lv) / 100;
}
if ((skill_lv = pc->checkskill(sd, MO_SPIRITSRECOVERY)) > 0)
	sitting_regen->sp += skill_lv * 2 + skill_lv * st->max_sp / 500;

}

`
any class or just novice with nothing.

@tlacson7
Copy link
Author

tlacson7 commented Apr 8, 2021

oh, since player are automatically eject in that map because it has no save flag.

  • just use a gm account and save to that map. then relogin

@tlacson7
Copy link
Author

tlacson7 commented Apr 8, 2021

Steps to reproduce the behavior:

  1. using your GM account go to guild map.
  2. save on that map
  3. Relogin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants