1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Merge pull request #238 from adrian17/master

Change some comparisons in scenario_objectives_check()
This commit is contained in:
Ted John
2014-07-27 22:47:43 +01:00
4 changed files with 22 additions and 27 deletions

View File

@@ -950,7 +950,7 @@ static void input_hscrollbar_rightbutton(rct_window* w)
left += 3;
widgetWidth = widget->right - widget->left - 1;
if (scroll->flags & SCROLL_FLAG_VERTICAL)
if (scroll->flags & VSCROLLBAR_VISIBLE)
widgetWidth -= 11;
widgetWidth *= -1;
widgetWidth += scroll->h_right;
@@ -999,7 +999,7 @@ static void input_hscrollbar_left_trough(rct_window* w)
left = scroll->h_left;
widgetWidth = widget->right - widget->left - 1;
if (scroll->flags & SCROLL_FLAG_VERTICAL)
if (scroll->flags & VSCROLLBAR_VISIBLE)
widgetWidth -= 11;
left -= widgetWidth;
if (left < 0)
@@ -1044,7 +1044,7 @@ static void input_hscrollbar_right_trough(rct_window* w)
left = scroll->h_left;
widgetWidth = widget->right - widget->left - 1;
if (scroll->flags & SCROLL_FLAG_VERTICAL)
if (scroll->flags & VSCROLLBAR_VISIBLE)
widgetWidth -= 11;
left += widgetWidth;
widgetWidth *= -1;
@@ -1136,7 +1136,7 @@ static void input_vscrollbar_bottombutton(rct_window* w)
top += 3;
widgetHeight = widget->bottom - widget->top - 1;
if (scroll->flags & SCROLL_FLAG_HORIZONTAL)
if (scroll->flags & HSCROLLBAR_VISIBLE)
widgetHeight -= 11;
widgetHeight *= -1;
widgetHeight += scroll->v_bottom;
@@ -1185,7 +1185,7 @@ static void input_vscrollbar_top_trough(rct_window* w)
top = scroll->v_top;
widgetHeight = widget->bottom - widget->top - 1;
if (scroll->flags & SCROLL_FLAG_HORIZONTAL)
if (scroll->flags & HSCROLLBAR_VISIBLE)
widgetHeight -= 11;
top -= widgetHeight;
if (top < 0)
@@ -1230,7 +1230,7 @@ static void input_vscrollbar_bottom_trough(rct_window* w)
top = scroll->v_top;
widgetHeight = widget->bottom - widget->top - 1;
if (scroll->flags & SCROLL_FLAG_HORIZONTAL)
if (scroll->flags & HSCROLLBAR_VISIBLE)
widgetHeight -= 11;
top += widgetHeight;
widgetHeight *= -1;

View File

@@ -462,20 +462,20 @@ void scenario_objectives_check()
case OBJECTIVE_GUESTS_BY://1
if (cur_month_year == 8 * objective_year){
if (park_rating < 600 || guests_in_park < objective_guests)
scenario_failure();
else
if (park_rating >= 600 && guests_in_park >= objective_guests)
scenario_success();
else
scenario_failure();
}
break;
case OBJECTIVE_PARK_VALUE_BY://2
if (cur_month_year == 8 * objective_year) {
if (park_value < objective_currency)
scenario_failure();
else
if (park_value >= objective_currency)
scenario_success();
else
scenario_failure();
}
break;
@@ -486,14 +486,14 @@ void scenario_objectives_check()
case OBJECTIVE_GUESTS_AND_RATING://6
if (park_rating >= 700 && guests_in_park > objective_guests)
if (park_rating >= 700 && guests_in_park >= objective_guests)
scenario_success();
break;
case OBJECTIVE_MONTHLY_RIDE_INCOME://7
{
sint32 monthly_ride_income = RCT2_GLOBAL(RCT2_ADDRESS_MONTHLY_RIDE_INCOME, sint32);
if (monthly_ride_income > objective_currency)
if (monthly_ride_income >= objective_currency)
scenario_success();
break;
}
@@ -508,7 +508,7 @@ void scenario_objectives_check()
int rcs = 0;
for (int i = 0; i < MAX_RIDES; i++) {
ride = &g_ride_list[i];
if (ride->status && ride->excitement > objective_currency)
if (ride->status != RIDE_STATUS_CLOSED && ride->excitement >= objective_currency)
rcs++;
}
if (rcs >= 5)
@@ -518,7 +518,7 @@ void scenario_objectives_check()
case OBJECTIVE_REPLAY_LOAN_AND_PARK_VALUE://A
{
sint32 current_loan = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint32);
if (current_loan <= 0 && park_value > objective_currency)
if (current_loan <= 0 && park_value >= objective_currency)
scenario_success();
break;
}
@@ -526,7 +526,7 @@ void scenario_objectives_check()
{
sint32 income_sum = RCT2_GLOBAL(0x013578A4, sint32) + RCT2_GLOBAL(0x013578A0, sint32) +
RCT2_GLOBAL(0x0135789C, sint32) + RCT2_GLOBAL(0x01357898, sint32);
if (income_sum > objective_currency)
if (income_sum >= objective_currency)
scenario_success();
break;
}

View File

@@ -1022,13 +1022,13 @@ void widget_scroll_get_part(rct_window *w, rct_widget* widget, int x, int y, int
}
}
if ((w->scrolls[*scroll_id].flags & SCROLL_FLAG_HORIZONTAL) && y >= (w->y + widget->bottom - 11))
if ((w->scrolls[*scroll_id].flags & HSCROLLBAR_VISIBLE) && y >= (w->y + widget->bottom - 11))
{
//horizon scrollbar
int rightOffset = 0;
int iteratorLeft = widget->left + w->x;
int iteratorRight = widget->right + w->x;
if (w->scrolls[*scroll_id].flags & SCROLL_FLAG_VERTICAL)
if (w->scrolls[*scroll_id].flags & VSCROLLBAR_VISIBLE)
{
rightOffset = 11;
}
@@ -1057,13 +1057,13 @@ void widget_scroll_get_part(rct_window *w, rct_widget* widget, int x, int y, int
*output_scroll_area = SCROLL_PART_HSCROLLBAR_THUMB;
}
}
else if ((w->scrolls[*scroll_id].flags & SCROLL_FLAG_VERTICAL) && (x >= w->x + widget->right - 11))
else if ((w->scrolls[*scroll_id].flags & VSCROLLBAR_VISIBLE) && (x >= w->x + widget->right - 11))
{
//vertical scrollbar
int bottomOffset = 0;
int iteratorTop = widget->top + w->y;
int iteratorBottom = widget->bottom + w->y;
if (w->scrolls[*scroll_id].flags & SCROLL_FLAG_HORIZONTAL)
if (w->scrolls[*scroll_id].flags & HSCROLLBAR_VISIBLE)
{
bottomOffset = 11;
}

View File

@@ -93,11 +93,6 @@ typedef struct {
sint16 v_thumb_bottom; // 0x10
} rct_scroll;
typedef enum {
SCROLL_FLAG_HORIZONTAL = (1 << 0),
SCROLL_FLAG_VERTICAL = (1 << 4),
} SCROLL_FLAGS;
/**
* Window structure
* size: 0x4C0
@@ -209,7 +204,7 @@ typedef enum {
WF_WHITE_BORDER_MASK = (1 << 12) | (1 << 13),
} WINDOW_FLAGS;
enum {
enum SCROLL_FLAGS {
HSCROLLBAR_VISIBLE = (1 << 0),
HSCROLLBAR_THUMB_PRESSED = (1 << 1),
HSCROLLBAR_LEFT_PRESSED = (1 << 2),