TheEternalCitizens / mudlet-integration

A mudlet integration for The Eternal City
GNU General Public License v2.0
3 stars 0 forks source link

setCharacterLocation when out of mapped area #147

Closed davewiththenicehat closed 4 years ago

davewiththenicehat commented 4 years ago

parthiaMap.addRoom, done: https://github.com/TheEternalCitizens/mudlet-integration/commit/316228400a1dbe3e5029f281271569d538970c71 line:11:if parthiaMap.getRoomCreationStop() then, that if and the remaining elseif not statments add a parthiaMap.setCharacterLocation to save the character location. Without it the characters location will not get set, that happens at line 75 in this function.

Steps below will resolve issue when mapping is disabled and player moves to an unmapped space.

davewiththenicehat commented 4 years ago

Save and load coordinates when room id is unavailable:

parthiaMap.setCharacterLocation, done: https://github.com/TheEternalCitizens/mudlet-integration/commit/c6de32cfc03c7d292cd9cb3f122e8ef54b0d12bf, and https://github.com/TheEternalCitizens/mudlet-integration/commit/f2f57049828432c3d26821ff147d4a8b0e78457d only record room id when it is available. If room id available, gather coordinates and area from mapper. Always record coordinates and current area. If room id is not available, record it as false. Move the reset variables code after command line:29:--reset movement variables to defaults out of if line:17:if id then. So it runs even when an ID is not available. Move the table save if statment line:38:if parthiaMap.saveTable[parthiaPlayer.CurrentCharacter.name] then outside of the line:17:if id then. So it runs even when an ID is not available. This will not be an issue because room id will be false so it can still be recorded, as false. Make certain current line:53parthiaMap.roomUserDataCheck() STAYS in line:17:if id then. It requires a working room id to function.

parthiaMap.checkCharacter(), done: https://github.com/TheEternalCitizens/mudlet-integration/commit/0d64daceb52d484b0b351c16fa03820dd81744ab Below current line:21:if parthiaMap.saveTable[character].roomID then add if parthiaMap.saveTable[character].roomID == 0. In that if change the characters area parthiaMap.currentArea and coordinates to parthiaMap.room.coords that should work with parthiaMap.Move current line:131if previousRoom.coords then --if we know the previous rooms coordinates use them

function parthiaMap.Move, add a call to parthiaMap.setCharacterLocation int the else, just after the mapDebug. Currently would go in line 253. done: https://github.com/TheEternalCitizens/mudlet-integration/commit/316228400a1dbe3e5029f281271569d538970c71

if parthiaMap.mapping then --if player is creating new maps
      parthiaMap.addRoom() --we are mapping in a space with no previous room, add one.
    else
      mapDebug("function parthiaMap.Move, Mapping currently disabled. In unmapped area.")
    end --if parthiaMap.mapping
davewiththenicehat commented 4 years ago

Completed with commits in comments.