Fix issue where killing an enemy resulted in orb being rendered with rat sprite on top
This commit is contained in:
@@ -128,7 +128,8 @@ function handleAttack(w: World, actor: Actor, action: { targetId: EntityId }): S
|
||||
w.actors.delete(target.id);
|
||||
|
||||
// Spawn EXP Orb
|
||||
const expAmount = target.type === "rat" ? GAME_CONFIG.enemy.ratExp : GAME_CONFIG.enemy.batExp;
|
||||
const enemyDef = (GAME_CONFIG.enemies as any)[target.type || ""];
|
||||
const expAmount = enemyDef?.expValue || 0;
|
||||
const orbId = Math.max(0, ...w.actors.keys(), target.id) + 1;
|
||||
w.actors.set(orbId, {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user