Update sprite bounds after undefining a block, fixes say being in a map which redefined rope then going to a map with normal rope block (Thanks Fam0r, fixes #459)

This commit is contained in:
UnknownShadow200 2020-10-28 00:26:18 +11:00
parent 25e8a4dfcc
commit e10cb1a566

View File

@ -1665,9 +1665,7 @@ static void BlockDefs_DefineBlock(cc_uint8* data) {
BlockDefs_DefineBlockCommonEnd(data, shape, block);
/* Update sprite BoundingBox if necessary */
if (Blocks.Draw[block] == DRAW_SPRITE) {
Block_RecalculateBB(block);
}
if (Blocks.Draw[block] == DRAW_SPRITE) Block_RecalculateBB(block);
}
static void BlockDefs_UndefineBlock(cc_uint8* data) {
@ -1686,6 +1684,8 @@ static void BlockDefs_UndefineBlock(cc_uint8* data) {
Block_SetCustomDefined(block, false);
Event_RaiseVoid(&BlockEvents.BlockDefChanged);
/* Update sprite BoundingBox if necessary */
if (Blocks.Draw[block] == DRAW_SPRITE) Block_RecalculateBB(block);
}
static void BlockDefs_DefineBlockExt(cc_uint8* data) {