Skip to content

Commit

Permalink
Allow only spawned NPCs to chat. (Otherwise stacktrace error)
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Nov 28, 2013
1 parent cdcfa92 commit 5bb4f34
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -131,7 +131,9 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
if (dNPC.matches(talker)) {
dNPC npc = dNPC.valueOf(talker);
context.setTalker(npc.getEntity());
npc.getCitizen().getDefaultSpeechController().speak(context, "chat");
if (npc.isSpawned())
npc.getCitizen().getDefaultSpeechController().speak(context, "chat");
else dB.echoDebug(scriptEntry, "NPC Talker is not spawned! Cannot talk.");

} else if (dPlayer.matches(talker)) {

Expand Down

0 comments on commit 5bb4f34

Please sign in to comment.