Fixed offset not being set in SetSpriteBox

This commit is contained in:
n00b
2025-04-14 19:07:20 -04:00
parent edb6462752
commit 020f107952
2 changed files with 209 additions and 207 deletions

View File

@@ -650,6 +650,8 @@ void rc_setSpriteBox(int spr_id, int w, int h)
b2PolygonShape* fix_shape = (b2PolygonShape*)rc_sprite[spr_id].physics.shape;
fix_shape->SetAsBox(w/2, h/2);
rc_sprite[spr_id].physics.offset_x = w/2;
rc_sprite[spr_id].physics.offset_y = h/2;
rc_sprite[spr_id].physics.box_width = w;
rc_sprite[spr_id].physics.box_height = h;