summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorzlago2025-01-26 19:03:31 +0100
committerzlago2025-01-26 19:03:31 +0100
commitcc0650b5d0fd31128263a3ad2437a7e13e92e5da (patch)
tree2b754e779c1d2d34aca577fe6670ea13f556fa98 /src
parentd8412decc77f38880b577b7c1f9b2e61aa438a66 (diff)
fix hp upon respawning
when respawning the player properties would depend on their state upon the last screen transition
Diffstat (limited to 'src')
-rw-r--r--src/main.c1
-rw-r--r--src/save.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index f86ed0b..c10657a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -410,7 +410,6 @@ int main(int const argc, char *const *const argv) {
 		
 		particle_tex = res_get_texture("particles").data;
 
-		player_new(&next_entities);
 		FILE *file = fopen(save_file_name, "rb");
 		if (file == NULL) {
 			if (errno != ENOENT) {
diff --git a/src/save.c b/src/save.c
index faeb8d1..83e21de 100644
--- a/src/save.c
+++ b/src/save.c
@@ -38,6 +38,7 @@ int game_load(FILE *file) {
 		fputs("invalid save format\n", stderr);
 		return 1;
 	}
+	player_new(&next_entities);
 	player_property(next_entities.player, "x", filedata);
 	filedata += len + 1;
 	len = strnlen(filedata, filesize);