summaryrefslogtreecommitdiff
path: root/src/CApi.h
diff options
context:
space:
mode:
authorSteph Enders <smenders@gmail.com>2022-06-27 17:45:44 -0400
committerSteph Enders <smenders@gmail.com>2022-06-27 17:45:44 -0400
commit38d46b2dda0243cfa60bc6945859ebd587e0a851 (patch)
tree3af0286199c6075ad50c36f2218c1c303f9fa921 /src/CApi.h
parent734ee0f6352fdb6077c142d90f191c11c32f98d2 (diff)
Update MacOS to compile w/ Boost
MacOS seems to rely on an older/different C++ stdlib than Windows or Linux. So replacing those with Boost equivalents. Mostly contained to the Resources thankfully!
Diffstat (limited to 'src/CApi.h')
-rw-r--r--src/CApi.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/CApi.h b/src/CApi.h
index 21ad9eb..4d35939 100644
--- a/src/CApi.h
+++ b/src/CApi.h
@@ -203,7 +203,16 @@ static int c_get_treasures(lua_State *L) {
static int c_score_treasure(lua_State *L) {
int id = static_cast<int>(lua_tonumber(L, -1));
+#ifdef __APPLE__
+ for (int i = 0; i < lvl->treasurePositions.size(); i++) {
+ if (lvl->treasurePositions[i].id == id) {
+ lvl->treasurePositions.erase(lvl->treasurePositions.begin() + i);
+ break;
+ }
+ }
+#else
erase_if(lvl->treasurePositions, [id](Pos t) { return t.id == id; });
+#endif
return 1;
}