Remove road tool broken

Got a problem with TTDPatch? Get help here.

Moderator: TTDPatch Moderators

Post Reply
User avatar
WWTBAM
Moderator
Moderator
Posts: 3682
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Remove road tool broken

Post by WWTBAM » 26 Sep 2013 05:38

Lakie pointed out to me that when using the remove road tool on a sloped tile that has both road and tram tracks on it doesn't work correctly. It appears to correctly remove the road but clicking the same tile again then adds the road back this happens no matter how many times the road is removed or added. I think the offending code is in the function at line 217 in trams.asm

Code: Select all

insertTramTrackIntoRemove:
	call	[gettileinfo]			;get the standard tile info
	test	byte [esp+4], 80h		;test the trams flag, as saved by our caller
	jz	.dontLoadTramArray
	cmp	byte [demolishroadflag],1	;are we dynamiting? or removing?
	//je	.dontLoadTramArray		;if we're dynamiting, then just continue, all gets removed
	cmp	bl, 28h
	je	.removetramfromstation
	mov	byte dh, [landscape3+esi*2]	;trams... move in the current tram tracks
The two things that make me think it's that code are the name of the function and when I remove the line

Code: Select all

jz	.dontLoadTramArray
the game refuses to let me remove a sloped road only tile.

I haven't tried attaching ollydebug to the Patch yet as I am not sure how to use it's output for working out what goes on when I do the actions that cause the bug.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/

User avatar
WWTBAM
Moderator
Moderator
Posts: 3682
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Remove road tool broken

Post by WWTBAM » 26 Sep 2013 16:37

I have fixed this now with Lakie's help.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/

Post Reply

Return to “Problems with TTDPatch”

Who is online

Users browsing this forum: No registered users and 1 guest