Skip to content

Commit 9c20cb8

Browse files
committed
Fixed death not saved
1 parent 5176583 commit 9c20cb8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/main/java/ml/sakii/factoryisland/Game.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ public void run() {
417417
Engine.performTick();
418418
tickCounter -= MAX_TICKS;
419419
}
420+
421+
if(PE.getHealth()==0) {
422+
Engine.world.hurtEntity(PE.ID, 0, false);
423+
}
420424
}
421425

422426
firstframe = false;
@@ -1274,9 +1278,7 @@ void start() {
12741278

12751279

12761280

1277-
if(PE.getHealth()==0) {
1278-
Engine.world.hurtEntity(PE.ID, 0, false);
1279-
}
1281+
12801282

12811283

12821284
centerMouse();
@@ -1351,7 +1353,9 @@ public void run() {
13511353

13521354
public void respawn() {
13531355
PE.getPos().set(Engine.world.getSpawnBlock().pos).add(new Vector(0,0,2.7f));
1356+
PE.ViewAngle.set(-135,0);
13541357
PE.setHealth(PE.maxHealth);
1358+
PE.VerticalVector.z = Math.signum(PE.getPos().z);
13551359
Engine.world.addEntity(PE, true);
13561360
}
13571361

src/main/java/ml/sakii/factoryisland/World.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,10 +635,12 @@ public boolean hurtEntity(long ID, int points, boolean resend) {
635635
game.notifyDeath();
636636
}else {
637637
game.Objects.removeAll(e.Objects);
638+
Entities.remove(ID);
638639
}
640+
}else {
641+
Entities.remove(ID);
639642
}
640643

641-
Entities.remove(ID);
642644

643645
return false;
644646

0 commit comments

Comments
 (0)