Add direction to the door
This commit is contained in:
@ -129,6 +129,32 @@ void assetMapLoad(
|
||||
signTextSet(&ent->sign, val->string);
|
||||
}
|
||||
break;
|
||||
|
||||
case ENTITY_TYPE_DOOR:
|
||||
val = assetJsonGetObjectValue(jEnt, "door");
|
||||
if(val != NULL) {
|
||||
assetjson_t *door = assetJsonGetObjectValue(val, "x");
|
||||
x = (int32_t)door->number;
|
||||
assertTrue(
|
||||
door->type == ASSET_JSON_DATA_TYPE_NUMBER,
|
||||
"assetMapLoad: Door x is not a number!"
|
||||
);
|
||||
|
||||
door = assetJsonGetObjectValue(val, "y");
|
||||
y = (int32_t)door->number;
|
||||
assertTrue(
|
||||
door->type == ASSET_JSON_DATA_TYPE_NUMBER,
|
||||
"assetMapLoad: Door y is not a number!"
|
||||
);
|
||||
entitydirection_t direction = (entitydirection_t)assetJsonGetObjectValue(
|
||||
val, "direction"
|
||||
)->number;
|
||||
doorDestinationSet(&ent->door, x, y, direction);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO: Parse any extra data.
|
||||
|
Reference in New Issue
Block a user