summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiegoisawesome <diego@domoreaweso.me>2018-08-15 18:50:56 -0700
committerDiegoisawesome <diego@domoreaweso.me>2018-08-15 19:49:17 -0700
commit2b81db7acecd8baa3e343de66fd229040ec81381 (patch)
tree68abd7e204f09d445d9b43aa8abc667fc4dbac50
parent8ac98f74416bbe5ef3159fdb954455165ce767e8 (diff)
Fix Task_Truck1
-rw-r--r--src/field_special_scene.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/field_special_scene.c b/src/field_special_scene.c
index 6f33b2c9b..c6cb0741d 100644
--- a/src/field_special_scene.c
+++ b/src/field_special_scene.c
@@ -63,32 +63,24 @@ s16 GetTruckBoxMovement(int a1) // for the box movement?
return 0;
}
-// smh STILL BROKEN IN EMERALD
void Task_Truck1(u8 taskId)
{
s16 *data = gTasks[taskId].data;
- s16 cameraYpan;
- s16 box1 = 0;
- s16 box2 = 0;
- s16 box3 = 0;
- u8 mapNum, mapGroup;
- register s16 zero asm("r4");
+ s16 cameraXpan = 0, cameraYpan = 0;
+ s16 box1, box2, box3;
box1 = GetTruckBoxMovement(data[0] + 30) * 4; // top box.
- sub_808E82C(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, box1 + 3);
+ sub_808E82C(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
box2 = GetTruckBoxMovement(data[0]) * 2; // bottom left box.
- sub_808E82C(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, box2 - 3);
+ sub_808E82C(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
box3 = GetTruckBoxMovement(data[0]) * 4; // bottom right box.
- mapNum = gSaveBlock1Ptr->location.mapNum;
- mapGroup = gSaveBlock1Ptr->location.mapGroup;
- zero = 0;
- sub_808E82C(3, mapNum, mapGroup, -3, box3);
+ sub_808E82C(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
if (++data[0] == SECONDS(500)) // this will never run
- data[0] = zero; // reset the timer if it gets stuck.
+ data[0] = 0; // reset the timer if it gets stuck.
cameraYpan = GetTruckCameraBobbingY(data[0]);
- SetCameraPanning(0, cameraYpan);
+ SetCameraPanning(cameraXpan, cameraYpan);
}
void Task_Truck2(u8 taskId)