diff --git a/core/src/com/riiablo/ai/Npc.java b/core/src/com/riiablo/ai/Npc.java index f73eccaf..74682c1b 100644 --- a/core/src/com/riiablo/ai/Npc.java +++ b/core/src/com/riiablo/ai/Npc.java @@ -172,7 +172,7 @@ public class Npc extends AI { } else if (actionTimer > 0) { actionTimer -= delta; actionPerformed = actionTimer < 0; - if (!actionPerformed) { + if (!actionPerformed && Riiablo.game != null) { // FIXME: checking Riiablo.game != null for server instances int player = Riiablo.game.player; Vector2 targetPos = mPosition.get(player).position; Vector2 entityPos = mPosition.get(entityId).position; diff --git a/core/src/com/riiablo/audio/ServerAudio.java b/core/src/com/riiablo/audio/ServerAudio.java new file mode 100644 index 00000000..70c4673f --- /dev/null +++ b/core/src/com/riiablo/audio/ServerAudio.java @@ -0,0 +1,25 @@ +package com.riiablo.audio; + +import com.badlogic.gdx.assets.AssetManager; +import com.riiablo.codec.excel.Sounds; + +public class ServerAudio extends Audio { + public ServerAudio(AssetManager assets) { + super(assets); + } + + @Override + public Instance play(int id, boolean global) { + return null; + } + + @Override + public Instance play(String id, boolean global) { + return null; + } + + @Override + public synchronized Instance play(Sounds.Entry sound, boolean global) { + return null; + } +} diff --git a/server/d2gs/src/com/riiablo/server/d2gs/D2GS.java b/server/d2gs/src/com/riiablo/server/d2gs/D2GS.java index eeedb472..686792f5 100644 --- a/server/d2gs/src/com/riiablo/server/d2gs/D2GS.java +++ b/server/d2gs/src/com/riiablo/server/d2gs/D2GS.java @@ -25,11 +25,13 @@ import com.riiablo.COFs; import com.riiablo.CharData; import com.riiablo.Files; import com.riiablo.Riiablo; +import com.riiablo.audio.ServerAudio; import com.riiablo.codec.Animation; import com.riiablo.codec.D2; import com.riiablo.codec.StringTBLs; import com.riiablo.engine.Engine; import com.riiablo.engine.EntityFactory; +import com.riiablo.engine.server.AIStepper; import com.riiablo.engine.server.AnimDataResolver; import com.riiablo.engine.server.CofManager; import com.riiablo.engine.server.ItemInteractor; @@ -39,6 +41,7 @@ import com.riiablo.engine.server.Pathfinder; import com.riiablo.engine.server.SerializationManager; import com.riiablo.engine.server.ServerEntityFactory; import com.riiablo.engine.server.ServerNetworkIdManager; +import com.riiablo.engine.server.VelocityAdder; import com.riiablo.engine.server.WarpInteractor; import com.riiablo.engine.server.component.Networked; import com.riiablo.engine.server.component.Player; @@ -199,6 +202,7 @@ public class D2GS extends ApplicationAdapter { Riiablo.cofs = new COFs(Riiablo.assets); // TODO: not needed in prod Riiablo.string = new StringTBLs(Riiablo.mpqs); // TODO: not needed in prod Riiablo.anim = D2.loadFromFile(Riiablo.mpqs.resolve("data\\global\\eanimdata.d2")); + Riiablo.audio = new ServerAudio(Riiablo.assets); // set DT1 to headless mode DT1.loadData = false; @@ -235,9 +239,11 @@ public class D2GS extends ApplicationAdapter { .with(new ObjectInitializer()) .with(new ObjectInteractor(), new WarpInteractor(), new ItemInteractor()) -// .with(new AIStepper()) + .with(new AIStepper()) .with(new Pathfinder()) + .with(new VelocityAdder()) // FIXME: temp until proper physics implemented + .with(factory) .with(sync) .with(new AnimDataResolver())