Skip to content

Commit

Permalink
Добавил ассертов, чтобы было понятно, почему вылетает
Browse files Browse the repository at this point in the history
  • Loading branch information
xrSimpodin committed Sep 22, 2018
1 parent 991a0fb commit 757882c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions ogsr_engine/xrGame/ui/UIEditKeyBind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void CUIEditKeyBind::Register(const char* entry, const char* group)
{
CUIOptionsItem::Register (entry, group);
m_action = action_name_to_ptr (entry);
ASSERT_FMT(m_action, "Action [%s] not found. Group: [%s]", entry, group);
}

void CUIEditKeyBind::SetCurrentValue()
Expand Down
4 changes: 3 additions & 1 deletion ogsr_engine/xrGame/ui/UIOptionsItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ char* CUIOptionsItem::GetOptTokenValue()

xr_token* CUIOptionsItem::GetOptToken()
{
return Console->GetXRToken(m_entry.c_str());
auto* token = Console->GetXRToken(m_entry.c_str());
ASSERT_FMT(token, "Can't find token [%s]", m_entry.c_str());
return token;
}

void CUIOptionsItem::SaveOptTokenValue(const char* val){
Expand Down
2 changes: 2 additions & 0 deletions ogsr_engine/xrGame/xr_level_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ std::vector<_action> actions = {

DEF_ACTION("quick_save", kQUICK_SAVE)
DEF_ACTION("quick_load", kQUICK_LOAD)

DEF_ACTION("artefact", kARTEFACT)
};

std::vector<_binding> g_key_bindings;
Expand Down
2 changes: 2 additions & 0 deletions ogsr_engine/xrGame/xr_level_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ enum EGameActions
kQUICK_SAVE,
kQUICK_LOAD,

kARTEFACT,

kLASTACTION = u32(-3),
kNOTBINDED = u32(-2),
kFORCEDWORD = u32(-1)
Expand Down

0 comments on commit 757882c

Please sign in to comment.