Home » MODDING HQ 1.13 » v1.13 General Development Talk » Hand to hand fighting (bug report) (Wrong mouse cursor during hand to hand fighting)
icon8.gif  Hand to hand fighting (bug report)[message #358286] Sat, 19 October 2019 04:59 Go to next message
MH17

 
Messages:46
Registered:November 2018
Location: Antarctica
I'd like to report one more bug.


Software setup: Win 7.0 + Ja2 1.13 (8696 exec) + Urban Chaos v4.6x 20190510
Bug description: I observe a problem with a mouse cursor during hand to hand combat with a hostile civilian in metro sector D6 of Port Kip city (San Mona in Vanilla game). When I move my mouse trying to punch the civilian's face or body the mouse cursor doesnt turn into a red fist. But it changes into the red fist when I move the cursor to the legs of the enemy.

Suggested bug location: It seems to me there is something wrong with the code lines 2903-2912 inside function "GetActionModeCursor" in file "UI cursors.cpp":

	if ( ubCursor == INVALIDCURS || usInHand == NONE )
	{
		INT32 usMapPos = NOWHERE;
		GetMouseMapPos( &usMapPos );

		UINT16 structindex;
		UINT16 possibleaction = InteractiveActionPossibleAtGridNo( usMapPos, pSoldier->pathing.bLevel, structindex );
		if ( possibleaction > INTERACTIVE_STRUCTURE_NO_ACTION )
			ubCursor = INTERACTIVEACTIONCURS;
	}

Before my game reaches its first line everything is fine and the value of the ubCursor is equal 2 (corresponds to PUNCHCURS). If I'm trying to punch the body of the enemy the call of the function "InteractiveActionPossibleAtGridNo" returns 3 and the if-condition underneath resets the correct value of the variable ubCursor into INTERACTIVEACTIONCURS. If I aim the punch into legs of the enemy the function "InteractiveActionPossibleAtGridNo" returns 0, and the variable ubCursor remains to stay intact keeping a correct value.

As I understand the function "InteractiveActionPossibleAtGridNo" is responsible for mouse interaction with surrounding environment. May be we should turn it off during combat?

[Updated on: Sat, 19 October 2019 05:00]

Re: Hand to hand fighting (bug report)[message #358290 is a reply to message #358286] Sat, 19 October 2019 12:24 Go to previous messageGo to next message
silversurfer

 
Messages:2795
Registered:May 2009
I don't think we should turn off interactive tile actions during combat. We may want to use them, for example refill a canteen.

The problem I see is the initial if condition. It will always trigger if we have nothing in hand. If the enemy just stole our weapon we can't even punch him in the face for it. So my suggestion would be to change the condition from:

if ( ubCursor == INVALIDCURS || usInHand == NONE )
to:
if ( ubCursor == INVALIDCURS )

This way it would only trigger if we do not have an action selected already.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

icon14.gif  Re: Hand to hand fighting (bug report)[message #358291 is a reply to message #358290] Sat, 19 October 2019 13:57 Go to previous messageGo to next message
MH17

 
Messages:46
Registered:November 2018
Location: Antarctica
Hello SilverSurfer!
Yeaaaah, your idea works!
As I understand situation: my boxing bout happens in the subway's restroom.
The mouse cursor floats over opponent's body animation overlapping toilet sink.
As a result the code gets confused.

PS: I think I have few other bugs coming soon.

[Updated on: Sat, 19 October 2019 14:21]

icon8.gif  Re: Hand to hand fighting (bug report)[message #358292 is a reply to message #358291] Sat, 19 October 2019 15:10 Go to previous message
MH17

 
Messages:46
Registered:November 2018
Location: Antarctica
I'd like to report other strange issue.

Bug description: One of my spies (Spy/MA/Athletics) stays next to his opponent shoulder to shoulder. When I move my mouse cursor over the body of the enemy the cursor turns into a red punch pointer. When I try to hit the enemy by the mouse left button double click nothing happens. Expected behaviour: my soldier turns right to face his opponent and delivers a punch.

Results of the bug tracing: I found out that the game engine code doesnt generate an event associated with the punch in a function "AdjustToNextAnimationFrame" (file "Soldier Ani.cpp"), line 381. There has to be a call of "AddGameEvent" to generate a new in-game event which never happens. I dont know where to look further, any insight will be highly appreciated.
Previous Topic: How to change loading screens?
Next Topic: Using older sti-graphics
Goto Forum:
  


Current Time: Mon Jan 18 14:43:59 EET 2021

Total time taken to generate the page: 0.01701 seconds