summaryrefslogtreecommitdiff
path: root/src/goal_base.h
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2013-05-26 19:54:43 +0000
committerzuu <zuu@openttd.org>2013-05-26 19:54:43 +0000
commita4cddc3e082e2bba80644792b2f6623979328e65 (patch)
tree803c694f123792d7b54f45fdd2d3f83dc3bcc8a5 /src/goal_base.h
parent05c472f08afdfc6d56fa45f941c17657358d0733 (diff)
downloadopenttd-a4cddc3e082e2bba80644792b2f6623979328e65.tar.xz
(svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed.
Diffstat (limited to 'src/goal_base.h')
-rw-r--r--src/goal_base.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/goal_base.h b/src/goal_base.h
index 6afbbd28b..b768c354c 100644
--- a/src/goal_base.h
+++ b/src/goal_base.h
@@ -19,12 +19,14 @@
typedef Pool<Goal, GoalID, 1, 256> GoalPool;
extern GoalPool _goal_pool;
-/** Struct about subsidies, offered and awarded */
+/** Struct about goals, current and completed */
struct Goal : GoalPool::PoolItem<&_goal_pool> {
CompanyByte company; ///< Goal is for a specific company; INVALID_COMPANY if it is global
GoalTypeByte type; ///< Type of the goal
GoalTypeID dst; ///< Index of type
char *text; ///< Text of the goal.
+ char *progress; ///< Progress text of the goal.
+ bool completed; ///< Is the goal completed or not?
/**
* We need an (empty) constructor so struct isn't zeroed (as C++ standard states)
@@ -34,7 +36,7 @@ struct Goal : GoalPool::PoolItem<&_goal_pool> {
/**
* (Empty) destructor has to be defined else operator delete might be called with NULL parameter
*/
- inline ~Goal() { free(this->text); }
+ inline ~Goal() { free(this->text); free(this->progress); }
};
#define FOR_ALL_GOALS_FROM(var, start) FOR_ALL_ITEMS_FROM(Goal, goal_index, var, start)