FixBadActorPositionOnPartyChange

Prevents actor-battlers positioning on default battle-screen too far to the right when the party changes mid-battle in a game that has set actor-placement to manual.

Originally made and first released by Cherry.

RPG2003
1.00UNKNOWN1UNKNOWN21.0.2.1
1.0.2.1
1.0.3.0
1.0.4.0
1.0.5.0
1.0.5.0
1.0.6.0
1.0.6.0
1.0.7.0
1.0.7.0
1.0.8.0
1.0.8.0
1.0.9.1
1.0.9.1
1.101.111.12mp210414

Segment 1/1

Offsets

RPG2003
1.0.9.1
1.0.9.1
1.101.111.12mp210414
004ABBB8h
000AAFB8h

Sourcecode

PROC__004ABBB8h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			PUSH EBP
			PUSH ECX
			MOV EAX, [004CDB74h]
			MOV EAX, [EAX]
			MOV EBP, [EAX+04h]
			DEC EBP
			TEST EBP, EBP
			JL __004ABD1Ah
			INC EBP
			XOR ESI, ESI
__004ABBD3h:
			MOV EAX, [004CDB74h]
			MOV EAX, [EAX]
			PUSH EAX
			MOV EDX, ESI
			CALL PROC__004A439Ch
			MOV EBX, EAX
			POP EAX
			MOV EAX, [EAX+04h]
			DEC EAX
			CMP ESI, EAX
			JNE __004ABBF4h
			MOV EAX, EBX
			CALL PROC__004ADA00h
__004ABBF4h:
			CMP DWORD PTR [EBX+74h], 0
			JNE __004ABC03h
			MOV DWORD PTR [ESP], 24
			JMP __004ABC08h
__004ABC03h:
			XOR EAX, EAX
			MOV [ESP], EAX
__004ABC08h:
			MOV EAX, [004CDD38h]
			MOV EAX, [EAX]
			MOV EDI, [EAX+94h]
			MOV EAX, [004CDD60h]
			MOV EAX, [EAX]
			CMP DWORD PTR [EAX+04h], 0
			JNE __004ABC83h
			CMP EDI, 2
			JNE __004ABC4Bh
			MOV EAX, [004CDD54h]
			MOV EAX, [EAX]
			MOV EDX, [EBX+04h]
			CALL PROC__004821B8h
			MOV EAX, [EAX+53Ch]
			ADD EAX, [ESP]
			MOV EDX, 320
			SUB EDX, EAX
			MOV [EBX+5Ch], EDX
			JMP __004ABC66h
__004ABC4Bh:
			MOV EAX, [004CDD54h]
			MOV EAX, [EAX]
			MOV EDX, [EBX+04h]
			CALL PROC__004821B8h
			MOV EAX, [EAX+53Ch]
			SUB EAX, [ESP]
			MOV [EBX+5Ch], EAX
__004ABC66h:
			MOV EAX, [004CDD54h]
			MOV EAX, [EAX]
			MOV EDX, [EBX+04h]
			CALL PROC__004821B8h
			MOV EAX, [EAX+540h]
			MOV [EBX+60h], EAX
			JMP __004ABCF5h
__004ABC83h:
			MOV EDX, [004CDD38h]
			MOV EDX, [EDX]
			MOV EAX, [EDX+A0h]
			PUSH EAX
			MOV EAX, [004CDB74h]
			MOV EAX, [EAX]
			MOV EAX, [EAX+04h]
			PUSH EAX
			PUSH ESI
			MOV EAX, [ESP+0Ch]
			PUSH EAX
			MOV ECX, [EDX+90h]
			MOV EAX, [004CDD60h]
			MOV EAX, [EAX]
			MOV EDX, EDI
			CALL PROC__0047EA00h
			MOV [EBX+5Ch], EAX
			MOV EAX, [004CDD38h]
			MOV EAX, [EAX]
			MOV EAX, [EAX+A0h]
			PUSH EAX
			MOV EAX, [004CDB74h]
			MOV EAX, [EAX]
			MOV EAX, [EAX+04h]
			PUSH EAX
			PUSH ESI
			MOV EAX, [004CDD38h]
			MOV EAX, [EAX]
			MOV ECX, [EAX+90h]
			MOV EAX, [004CDD60h]
			MOV EAX, [EAX]
			MOV EDX, EDI
			CALL PROC__0047EB4Ch
			SUB EAX, 24
			MOV [EBX+60h], EAX
__004ABCF5h:
			MOV EAX, [EBX+5Ch]
			MOV [EBX+54h], EAX
			MOV EAX, [EBX+60h]
			MOV [EBX+58h], EAX
			MOV ECX, ESI
			MOV EDX, EDI
			MOV EAX, EBX
			CALL PROC__004B41ACh
			MOV [EBX+48h], EAX
			INC ESI
			DEC EBP
			JNZ __004ABBD3h
			3 NOPs
__004ABD1Ah:
			POP EDX
			POP EBP
			POP EDI
			POP ESI
			POP EBX
			RET

Bytes

53 56 57 55 51 A174DB4C00 8B00 8B6804 40 85ED 0F8C4A010000
45 33F6 A174DB4C00 8B00 50 8BD6 E8BA87FFFF
8BD8 58 8B4004 48 3BF0 7507
8BC3 E80C1E0000
837B7400 7509
C7042418000000 EB05
33C0 890424 A138DD4C00 8B00 8BB894000000 A160DD4C00 8B00 83780400 7561
83FF02 7524
A154DD4C00 8B00 8B5304 E88265FDFF
8B803C050000 030424 BA40010000 2BD0 89535C EB1B
A154DD4C00 8B00 8B5304 E85E65FDFF
8B803C050000 2B0424 89435C A154DD4C00 8B00 8B5304 E84365FDFF
8B8040050000 894360 E972000000
8B1538DD4C00 8B12 8B82A0000000 50 A174DB4C00 8B00 8B4004
50 56 8B44240C 50 8B8A90000000 A160DD4C00 8B00 8BD7 E8492DFDFF
89435C A138DD4C00 8B00 8B80A0000000 50 A174DB4C00 8B00 8B4004
50 56 A138DD4C00 8B00 8B8890000000 A160DD4C00 8B00 8BD7 E85D2EFDFF
83E818 8943 60 8B435C 894354 8B4360 894358 8BCE 8BD7 8BC3 E8A0840000
894348 46 4D 0F85BCFEFFFF
90 90 90 5A 5D 5F 5E 5B C3