Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3227 closed defect (fixed)

Change perspective not working when starting the game as an observer

Reported by: elexis Owned by:
Priority: If Time Permits Milestone: Alpha 20
Component: UI & Simulation Keywords:
Cc: Patch:

Description

The change perspective functionality doesn't work properly when you start as an observer and change the perspective to a player. Then you can't train units, build buildings or do other stuff that requires the panel.

Pressing the idle worker hotkey in that case throws error messages too:

WARNING: JavaScript warning: simulation/components/GuiInterface.js line 1668
reference to undefined property data.prevUnit
ERROR: JavaScript error: simulation/components/GuiInterface.js line 1668
TypeError: data.excludeUnits is undefined
  GuiInterface.prototype.FindIdleUnits@simulation/components/GuiInterface.js:1668:1
  GuiInterface.prototype.ScriptCall@simulation/components/GuiInterface.js:1919:3
  findIdleUnit@gui/session/input.js:1737:7
  __eventhandler210 (press)@__internal(99) press:0:67
ERROR: Error calling component script function ScriptCall
ERROR: JavaScript error: gui/session/input.js line 1738
TypeError: idleUnits is undefined
  findIdleUnit@gui/session/input.js:1738:1
  __eventhandler210 (press)@__internal(99) press:0:67

Change History (4)

comment:1 by Itms, 9 years ago

Shouldn't it be normal to not be able to take over player control when you start as obs? You might want to switch perspective to see the fog of war, what is the information a player has wrt another one, etc.

Error messages and somewhat inconsistent behaviors should be fixed though.

comment:2 by elexis, 9 years ago

The current change perspective tool is supposed to be used only by developers and that in all cases possible, see #3155. Therefore this issue should be fixed too.

See also #3168.

comment:3 by elexis, 8 years ago

Milestone: BacklogAlpha 20
Resolution: fixed
Status: newclosed

Building stuff as observer using change perspective is fixed by r17617. Can't reproduce the idle-worker-hotkey bugs.

comment:4 by elexis, 8 years ago

Hotkey error unrelated: #3777

Note: See TracTickets for help on using tickets.