RanvierMUD / core

Core engine code for Ranvier
https://ranviermud.com
MIT License
45 stars 40 forks source link

moveTo on Npc and Player should pass the previousRoom to the event #40

Closed atarsha closed 5 years ago

atarsha commented 5 years ago

When you think about the fact that Npc passes nextRoom to the event: this.room.emit('npcLeave', this, nextRoom); (thisRoom can determine the direction the Npc went based on nextRoom)

Then, why shouldn't nextRoom also received thisRoom as an argument of where the npc arrived from instead of just nextRoom.emit('npcEnter', this);

I think this should be added to the moveTo method of both Npc and Player as they both work the same way.

shawncplus commented 5 years ago

I agree

atarsha commented 5 years ago

Okay great. I'll put a PR together :)