Allow using smaller value type tags for 16 bit/32 bit integer NBT value retrieval functions, addresses #966

This commit is contained in:
UnknownShadow200 2022-10-13 18:56:51 +11:00
parent a7893ca0ec
commit ca07e4ef33
2 changed files with 5 additions and 1 deletions

View File

@ -340,6 +340,7 @@ static cc_uint8 NbtTag_U8(struct NbtTag* tag) {
static cc_int16 NbtTag_I16(struct NbtTag* tag) {
if (tag->type == NBT_I16) return tag->value.i16;
if (tag->type == NBT_I8) return tag->value.u8;
tag->result = NBT_ERR_EXPECTED_I16;
return 0;
@ -347,6 +348,7 @@ static cc_int16 NbtTag_I16(struct NbtTag* tag) {
static cc_uint16 NbtTag_U16(struct NbtTag* tag) {
if (tag->type == NBT_I16) return tag->value.u16;
if (tag->type == NBT_I8) return tag->value.u8;
tag->result = NBT_ERR_EXPECTED_I16;
return 0;
@ -354,6 +356,8 @@ static cc_uint16 NbtTag_U16(struct NbtTag* tag) {
static int NbtTag_I32(struct NbtTag* tag) {
if (tag->type == NBT_I32) return tag->value.i32;
if (tag->type == NBT_I16) return tag->value.i16;
if (tag->type == NBT_I8) return tag->value.u8;
tag->result = NBT_ERR_EXPECTED_I32;
return 0;

View File

@ -176,7 +176,7 @@ static void RefreshWindowBounds(void) {
- (void)keyDown:(NSEvent *)event { }
@end
@interface CCWindowDelegate : NSObject<NSWindowDelegate> { }
@interface CCWindowDelegate : NSWindowDelegate { }
@end
@implementation CCWindowDelegate
- (void)windowDidResize:(NSNotification *)notification {