Skip to content

Commit ca7ec56

Browse files
add shitty way to delete goals
1 parent 8d806ff commit ca7ec56

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Profile.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,6 +3711,21 @@ class LunaProfile : public Luna<Profile>
37113711
return 1;
37123712
}
37133713

3714+
// make unshit -mina
3715+
static int RemoveGoalsByKey(T* p, lua_State *L) {
3716+
RString ck = SArg(1);
3717+
auto it = p->goalmap.find(ck);
3718+
if (it == p->goalmap.end()) {
3719+
lua_pushnil(L);
3720+
}
3721+
else {
3722+
p->goalmap.erase(ck);
3723+
SONGMAN->SetHasGoal(p->goalmap);
3724+
}
3725+
3726+
return 1;
3727+
}
3728+
37143729
static int GetAllGoals(T* p, lua_State *L) {
37153730
lua_newtable(L);
37163731
int idx = 0;
@@ -3810,6 +3825,7 @@ class LunaProfile : public Luna<Profile>
38103825
ADD_METHOD( GetPBHighScoreByKey );
38113826
ADD_METHOD( ValidateAllScores );
38123827
ADD_METHOD( GetGoalByKey );
3828+
ADD_METHOD( RemoveGoalsByKey );
38133829
ADD_METHOD( GetAllGoals );
38143830
}
38153831
};
@@ -3853,6 +3869,7 @@ class LunaScoreGoal : public Luna<ScoreGoal>
38533869
}
38543870
return 1;
38553871
}
3872+
38563873
static int SetPriority(T* p, lua_State *L) { p->priority = IArg(1); return 1; }
38573874
static int SetComment(T* p, lua_State *L) { p->comment = SArg(1); return 1; }
38583875

0 commit comments

Comments
 (0)