summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorexpwnent2012-08-27 15:06:41 -0400
committerexpwnent2012-08-27 15:06:41 -0400
commit1a5f05768f9abee0b932f712794045eef526cb2a (patch)
tree24f85ab10706be4fd2c3a3a755e936bdaf941e59
parent15adb17559992fd6feb87d26235c1280bf8c009c (diff)
downloaddfhack-1a5f05768f9abee0b932f712794045eef526cb2a.tar.gz
dfhack-1a5f05768f9abee0b932f712794045eef526cb2a.tar.bz2
dfhack-1a5f05768f9abee0b932f712794045eef526cb2a.tar.xz
Made it not run every tick.
-rw-r--r--plugins/misery.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/misery.cpp b/plugins/misery.cpp
index 260eedd8..9e0535d5 100644
--- a/plugins/misery.cpp
+++ b/plugins/misery.cpp
@@ -20,6 +20,8 @@ static map<int, int> processedThoughtCountTable;
//keep track of fake thoughts so you can remove them if requested
static vector<std::pair<int,int> > fakeThoughts;
+static int count;
+const int maxCount = 1000;
DFHACK_PLUGIN("misery");
@@ -46,6 +48,12 @@ DFhackCExport command_result plugin_onupdate(color_ostream& out) {
if ( !wasLoaded ) {
wasLoaded = true;
}
+
+ if ( count < maxCount ) {
+ count++;
+ return CR_OK;
+ }
+ count = 0;
int32_t race_id = df::global::ui->race_id;
int32_t civ_id = df::global::ui->civ_id;
@@ -172,3 +180,4 @@ command_result misery(color_ostream &out, vector<string>& parameters) {
return CR_OK;
}
+