Skip to content

Commit fde1a32

Browse files
authored
Merge branch 'develop' into feature/item-groups
2 parents eca6ea7 + ad8b48a commit fde1a32

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/engine/world/actor/player/player.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ export class Player extends Actor {
804804
let strHelp: string = '';
805805
if(command.args) {
806806
for(const arg of command.args) {
807-
if(arg.defaultValue) {
807+
if(arg.defaultValue !== undefined) {
808808
strHelp = `${strHelp} \\<${arg.name} = ${arg.defaultValue}>`;
809809
} else {
810810
strHelp = `${strHelp} \\<${arg.name}>`;

src/plugins/commands/spawn-npc-command.plugin.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ const action: commandActionHandler = ({ player, args }) => {
2424
npcKey = npcDetails.gameId;
2525
}
2626

27+
const movementRadius: number = args.movementRadius as number;
28+
2729
const npc = new Npc(npcDetails ? npcDetails : npcKey,
2830
new NpcSpawn(npcDetails ? npcDetails.key : `unknown-${npcKey}`,
29-
player.position.clone(), 0, 'WEST'), player.instance);
31+
player.position.clone(), movementRadius, 'WEST'), player.instance);
3032

3133
activeWorld.registerNpc(npc);
3234
};
@@ -41,6 +43,11 @@ export default {
4143
{
4244
name: 'npcKey',
4345
type: 'either'
46+
},
47+
{
48+
name: 'movementRadius',
49+
type: 'number',
50+
defaultValue: 0
4451
}
4552
],
4653
handler: action

0 commit comments

Comments
 (0)