Modify

Ticket #234 (closed bug: fixed)

Opened 10 years ago

Last modified 7 years ago

PARPG crashes if you try to move on a map with no objects

Reported by: kaydeth_parpg Owned by: parpg
Priority: major Milestone: Techdemo 1
Component: scripts Version: trunk
Keywords: Cc:
Blocked By: Blocking:
Department:

Description (last modified by kaydeth_parpg) (diff)

If you create a map that only has the PC and no other object than the game will crash when you hover the mouse over the PC character.

File "C:\Users\Kaydeth\Desktop\Projects\PARPG\FIFE engine\clients\parpg\run.py", line 160, in _pump

self.world.pump()

File "C:\Users\Kaydeth\Desktop\Projects\PARPG\FIFE engine\clients\parpg\scripts\world.py", line 357, in pump

self.highlightFrontObject()

File "C:\Users\Kaydeth\Desktop\Projects\PARPG\FIFE engine\clients\parpg\scripts\world.py", line 279, in highlightFrontObject

front_obj = self.getObjectAtCoords(self.last_mousecoords)

File "C:\Users\Kaydeth\Desktop\Projects\PARPG\FIFE engine\clients\parpg\scripts\world.py", line 313, in getObjectAtCoords

if(self.data.objectActive(obj.getId())):

File "C:\Users\Kaydeth\Desktop\Projects\PARPG\FIFE engine\clients\parpg\scripts\engine.py", line 207, in objectActive

self.game_state.getObjectsFromMap(self.game_state.current_map_name):

File "C:\Users\Kaydeth\Desktop\Projects\PARPG\FIFE engine\clients\parpg\scripts\gamestate.py", line 39, in getObjectsFromMap

return [i for i in self.objects[map_id].values() if map_id in self.objects]

KeyError?: 'map2'

Attachments

Change History

comment:1 Changed 10 years ago by kaydeth_parpg

  • Description modified (diff)

comment:2 Changed 10 years ago by Kaydeth_parpg

  • Status changed from new to closed
  • Resolution set to fixed

(In [432]) Ticket #234. Patch by Kaydeth. Added some error checking to the getObjectsFromMap method in GameState?. This way it can return an empty list if the given map_id doesn't exist in the GameState?. closes #234

comment:3 Changed 7 years ago by anonymous

Is this really the way it suppose to work? By the what could mean error fatal error access to undeclared static property ?

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.