mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-08 23:10:52 -04:00
Allow using smaller value type tags for 16 bit/32 bit integer NBT value retrieval functions, addresses #966
This commit is contained in:
parent
a7893ca0ec
commit
ca07e4ef33
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user