Add icemaker item spawn replay event

isolation_bkp/dynres
Dominik Madarász 2021-09-08 12:04:35 +02:00
parent 8b437d53cd
commit 664aa09654
2 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,7 @@ typedef enum {
RPKIND_PLACE_ICE_RINK, RPKIND_PLACE_ICE_RINK,
RPKIND_PLACE_ERASE_CHANGES, RPKIND_PLACE_ERASE_CHANGES,
RPKIND_SPAWN_CIRCLING_DRIVER, RPKIND_SPAWN_CIRCLING_DRIVER,
RPKIND_SPAWN_ICEMAKER_ITEM,
} replay_kind; } replay_kind;
typedef struct { typedef struct {
@ -166,9 +167,10 @@ void debug_replay_run(void) {
camera_set_follow(mime); camera_set_follow(mime);
} }
void ActPlaceIceRink(); void ActPlaceIceRink(void);
void ActSpawnCirclingDriver(void); void ActSpawnCirclingDriver(void);
void ActEraseWorldChanges(void); void ActEraseWorldChanges(void);
void ActSpawnIcemaker(void);
void debug_replay_update(void) { void debug_replay_update(void) {
if (!is_playing) return; if (!is_playing) return;
@ -211,6 +213,9 @@ void debug_replay_update(void) {
case RPKIND_PLACE_ERASE_CHANGES:{ case RPKIND_PLACE_ERASE_CHANGES:{
ActEraseWorldChanges(); ActEraseWorldChanges();
}break; }break;
case RPKIND_SPAWN_ICEMAKER_ITEM:{
ActSpawnIcemaker();
}break;
default: { default: {
ZPL_PANIC("unreachable"); ZPL_PANIC("unreachable");
}break; }break;

View File

@ -27,6 +27,8 @@ ActSpawnIcemaker(void) {
Position const* origin = ecs_get(world_ecs(), plr, Position); Position const* origin = ecs_get(world_ecs(), plr, Position);
Position * dest = ecs_get_mut(world_ecs(), e, Position, NULL); Position * dest = ecs_get_mut(world_ecs(), e, Position, NULL);
*dest = *origin; *dest = *origin;
debug_replay_special_action(RPKIND_SPAWN_ICEMAKER_ITEM);
} }
void void