Skip to content

Commit

Permalink
set the chartkey for scoregoals as they're being handed to lua and gi…
Browse files Browse the repository at this point in the history
…ve lua access to it
  • Loading branch information
MinaciousGrace committed Apr 28, 2017
1 parent d0e0c2f commit 206ee3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3718,6 +3718,7 @@ class LunaProfile : public Luna<Profile>
auto &sgv = i->second;
FOREACH(ScoreGoal, sgv, sg) {
ScoreGoal &tsg = *sg;
tsg.chartkey = ck;
tsg.PushSelf(L);
lua_rawseti(L, -2, idx + 1);
idx++;
Expand Down Expand Up @@ -3821,8 +3822,9 @@ class LunaScoreGoal : public Luna<ScoreGoal>
DEFINE_METHOD( GetPriority, priority );
DEFINE_METHOD( IsAchieved, achieved );
DEFINE_METHOD( GetComment, comment );
DEFINE_METHOD( GetChartKey, chartkey);
DEFINE_METHOD( WhenAssigned, timeassigned.GetString() );

static int WhenAchieved(T* p, lua_State *L) {
if (p->achieved)
lua_pushstring(L, p->timeachieved.GetString());
Expand All @@ -3846,6 +3848,7 @@ class LunaScoreGoal : public Luna<ScoreGoal>
ADD_METHOD( GetComment );
ADD_METHOD( WhenAssigned );
ADD_METHOD( WhenAchieved );
ADD_METHOD( GetChartKey );
}
};
LUA_REGISTER_CLASS(ScoreGoal)
Expand Down

0 comments on commit 206ee3e

Please sign in to comment.