-
Notifications
You must be signed in to change notification settings - Fork 46
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
Refactor as much as possible to GetEntInfo #245
Conversation
@@ -4,5 +4,6 @@ | |||
// This file gets included by each source file, just like in Chunsoft's original source, so we can have this string easily just like they did. | |||
|
|||
// Later, we can move this into "global.h" before the #ifdef guard. But we can only do this if "global.h" isn't included outside of .c files... | |||
#include "gba/defines.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, didn't mean to commit this, this was making coccinelle spew an annoying amount of errors on that ALIGNED(4) attribute if this was missing
@@ -549,7 +549,7 @@ void CheriBerryItemAction(Entity *pokemon, Entity *target) | |||
|
|||
void PechaBerryItemAction(Entity *pokemon, Entity *target) | |||
{ | |||
if((u8)(target->axObj.info->nonVolatile.nonVolatileStatus - 2) <= 1) | |||
if((u8)(GetEntInfo(target)->nonVolatile.nonVolatileStatus - 2) <= 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, that's not related, but since you're at it, maybe you could fix that as well? It's prolly nonVolatileStatus == 1 || nonVolatileStatus == 2
or sth similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept staring at this the past few PRs, but I think it's the crazy comparison macro, note that the u8 cast is after subtraction.
@@ -200,7 +200,7 @@ void HandleTakeItemAction(Entity *param_1) | |||
Item item; | |||
|
|||
entity = sub_8044DA4(param_1,0); | |||
info = entity->axObj.info; | |||
info = entity->axObj.info; // GetEntInfo doesn't work here, probably fixable | |||
info2 = entity->axObj.info; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work if you get rid of info2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope.
@@ -856,7 +856,7 @@ bool8 sub_8058270(Entity *pokemon, Entity *target, Move *move, u32 param_4) | |||
u32 r3; | |||
|
|||
r3 = 1; | |||
if((u8)(target->axObj.info->charging.chargingStatus - 7) <= 1) | |||
if((u8)(GetEntInfo(target)->charging.chargingStatus - 7) <= 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing with status here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
No description provided.