[BUG v1.9.2] Change Facing

Confirmed bugs should get a single post here. Check the READ ME FIRST sticky thread for the format.

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice, MapTool BugReport Manager

Forum rules
Posts that do not conform to the READ ME FIRST sticky thread are subject to deletion.
Post Reply
GDraghetti
Kobold
Posts: 6
Joined: Thu Mar 04, 2021 4:31 am

[BUG v1.9.2] Change Facing

Post by GDraghetti »

When I try to set the token facing get this error from Java:

Code: Select all

java.lang.NullPointerException: Cannot read the array length because "array" is null
	at net.rptools.maptool.util.TokenUtil.getIndexNearestTo(TokenUtil.java:32)
	at net.rptools.maptool.client.tool.FacingTool.mouseMoved(FacingTool.java:105)
	at java.desktop/java.awt.AWTEventMulticaster.mouseMoved(Unknown Source)
	at java.desktop/java.awt.Component.processMouseMotionEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:54)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
The error keeps appearing every time I move the mouse until I press the left button to set the facing.
Then the error disappear but none facing is set.
If a token has an facing use "Remove Facing" command do nothing and don't even show the error.

taustinoc
Dragon
Posts: 516
Joined: Mon Aug 03, 2015 6:30 pm

Re: [BUG v1.9.2] Change Facing

Post by taustinoc »

I can't duplicate the problem with any obvious approach, so perhaps more details are in order.

GDraghetti
Kobold
Posts: 6
Joined: Thu Mar 04, 2021 4:31 am

Re: [BUG v1.9.2] Change Facing

Post by GDraghetti »

Thanks for your answer.

I don't know how to recreate the problem.
I don't generally use facing.

The error occurs when I try to set facing by contextual menu (mouse right-click on token) on all tokens, but with macros I can set, change and remove the facing of all token, excluding a specific token that is "immune" to change

Macro Code:

Code: Select all

[r: getName(currentToken())] [r: getTokenFacing(currentToken())]&deg;<br />
[r: removeTokenFacing(currentToken())]
[r: getName(currentToken())] [r: getTokenFacing(currentToken())]&deg;<br />
The execution of this macro on the immune token give the right output:

Code: Select all

<token name> 0°
<token name> °
But when mouse get over this token the facing is automatically reset to 0° (and not to empty value).

If I try to change the facing via macro like this:

Code: Select all

[r: setTokenFacing(90, currentToken())]
The change is permanent (not reset to 0° when mouse over); but If I try to remove it, when mouse over, it's reset to 0°.

I have try to copy and paste the token, the problem remain on both original and copy. It's the same using copyToken() command.

Unfortunately I can not upload the campaign file (40 Mb).

I'm afraid I'll have to delete the "immune token" and recreate it.

GDraghetti
Kobold
Posts: 6
Joined: Thu Mar 04, 2021 4:31 am

Re: [BUG v1.9.2] Change Facing [Close]

Post by GDraghetti »

I have an update: I tried on another computer (with a fresh installation) and the java exception no longer occurs.

The inability to remove facing remains but I have found a workaround: if I remove all the flags in the token owners tab the problem disappears.

I hope this information can be useful for someone else.

Post Reply

Return to “Bug Reports”