Originally Posted by
Alucard
Pretty much like this. Thanks for advice. Now the thread should be marked as "Not a bug".
Which way would you find best?
CenterX(x+HitXOffset)
or
CenterX(x) + HitXOffset
The value would be different, and I'm thinking that returning CenterX(x) + HitXOffset is what is best, but may not be what you want. I hope that it is. I'll give you both versions, and you can tell me which one works as you want.
Code:
int CenterX(lweapon anLWeapon, bool trueoffset) {
if ( trueoffset ) return anLWeapon->X+8*anLWeapon->TileWidth + anLWeapon->HitXOffset;
else return CenterX(anLWeapon);
}
int CenterY(lweapon anLWeapon, bool trueoffset) {
if ( trueoffset ) return anLWeapon->Y+8*anLWeapon->TileHeight + anLWeapon->HitYOffset;
else return CenterX(anLWeapon);
}
I only now realised that both of these returns are identical, as I forgot to remove the + Hit*Offset in the else statement. :p
Fixed.
Tell me if this works for you, or if you need HitXOffset to be adjusted by TileWidth, and so forth.