Fixed construct bug

This commit is contained in:
Duncan Frost 2014-12-20 13:06:17 +00:00
parent a96bf872bf
commit acf6ef7b88
3 changed files with 14 additions and 9 deletions

View File

@ -702,9 +702,10 @@ static void ride_remove_peeps(int rideIndex)
ride->var_14D |= 4;
}
int sub_6C683D(int x, int y, int z, int direction, int type, int esi, int edi, int ebp)
int sub_6C683D(int* x, int* y, int z, int direction, int type, int esi, int edi, int ebp)
{
return RCT2_CALLPROC_X(0x006C683D, x, (direction << 8) | type, y, z, esi, edi, ebp)&0x100;
int ebx = (direction << 8) | type;
return RCT2_CALLFUNC_X(0x006C683D, x, &ebx, y, &z, &esi, &edi, &ebp)&0x100;
}
void sub_6C96C0()
@ -716,16 +717,19 @@ void sub_6C9627()
{
switch (RCT2_GLOBAL(0x00F440A6, uint8)) {
case 3:
{
int x = RCT2_GLOBAL(0x00F440A8, uint16), y = RCT2_GLOBAL(0x00F440AA, uint16);
sub_6C683D(
RCT2_GLOBAL(0x00F440A8, uint16),
RCT2_GLOBAL(0x00F440AA, uint16),
&x,
&y,
RCT2_GLOBAL(0x00F440AC, uint16),
RCT2_GLOBAL(0x00F440AE, uint8) & 3,
RCT2_GLOBAL(0x00F440AF, uint8),
0,
0,
1
);
);
}
break;
case 6:
case 7:
@ -893,7 +897,8 @@ int ride_modify(rct_map_element *mapElement, int x, int y)
z = mapElement->base_height * 8;
direction = mapElement->type & 3;
type = mapElement->properties.track.type;
if (sub_6C683D(x, y, z, direction, type, 0, 0, 0)) return 0;
if (sub_6C683D(&x, &y, z, direction, type, 0, 0, 0)) return 0;
RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex;
RCT2_GLOBAL(0x00F440A6, uint8) = 3;

View File

@ -629,7 +629,7 @@ void ride_breakdown_add_news_item(int rideIndex);
rct_peep *ride_find_closest_mechanic(rct_ride *ride, int forInspection);
int sub_6CC3FB(int rideIndex);
void sub_6C9627();
int sub_6C683D(int x, int y, int z, int direction, int type, int esi, int edi, int ebp);
int sub_6C683D(int* x, int* y, int z, int direction, int type, int esi, int edi, int ebp);
void ride_set_map_tooltip(rct_map_element *mapElement);
int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint16 sampleRate, uint32 position, uint8 *tuneId);
void ride_music_update_final();

View File

@ -287,7 +287,7 @@ void window_construction_mouseup(){
window_construction_mouseup_demolish(w);
break;
case 32:
RCT2_CALLPROC_X(0x6C98AA, 0, 0, 0, widgetIndex, (int)w, 0, 0);
RCT2_CALLPROC_X(0x6C78AA, 0, 0, 0, widgetIndex, (int)w, 0, 0);
break;
case 29:
RCT2_CALLPROC_X(0x6C7802, 0, 0, 0, widgetIndex, (int)w, 0, 0);
@ -318,7 +318,7 @@ void window_construction_mouseup_demolish(rct_window* w){
ecx = RCT2_GLOBAL(0xF440AA, uint16),
edx = RCT2_GLOBAL(0xF440AC, uint16);
sub_6C683D(eax, ecx, edx, RCT2_GLOBAL(0xF440AE, uint8), RCT2_GLOBAL(0xF440AF, uint8) & 0x3FF, 0, 0, 0);
sub_6C683D(&eax, &ecx, edx, RCT2_GLOBAL(0xF440AE, uint8), RCT2_GLOBAL(0xF440AF, uint8) & 0x3FF, 0, 0, 0);
}
int ride_id = RCT2_GLOBAL(0xF440A7, uint8);