Skip to content

Commit

Permalink
Minor update to Debug.PreAddCounter
Browse files Browse the repository at this point in the history
  • Loading branch information
edo9300 committed Feb 25, 2025
1 parent 405afd4 commit b5818e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libdebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ LUA_STATIC_FUNCTION(PreAddCounter) {
auto countertype = lua_get<uint16_t>(L, 2);
auto count = lua_get<uint16_t>(L, 3);
uint16_t cttype = countertype & ~COUNTER_NEED_ENABLE;
auto pr = pcard->counters.emplace(cttype, card::counter_map::mapped_type());
auto cmit = pr.first;
if(pr.second) {
auto [cmit, was_constructed] = pcard->counters.try_emplace(cttype, card::counter_map::mapped_type());
if(was_constructed) {
cmit->second[0] = 0;
cmit->second[1] = 0;
}
Expand Down

0 comments on commit b5818e2

Please sign in to comment.