Skip to content

Commit 3b8115c

Browse files
committed
Fix the case when there is no GameProfile
1 parent d374247 commit 3b8115c

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

lua/mantle_addons/fatedgang/interface/menu_tabs/players.lua

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,22 @@ FatedGang.add_tab(1, 'Игроки банды', 'fatedgang/tab_players.png', fun
113113
pl_btn.avatar:SetWide(32)
114114
pl_btn.avatar:SetSteamID(pl_data.steamid64, 128)
115115

116-
pl_btn.game_profile = vgui.Create('DButton', pl_btn)
117-
Mantle.ui.btn(pl_btn.game_profile, nil, nil, Color(44, 44, 44), 8, true, Color(34, 34, 34))
118-
pl_btn.game_profile:Dock(RIGHT)
119-
pl_btn.game_profile:DockMargin(6, 6, 6, 6)
120-
pl_btn.game_profile:SetWide(140)
121-
pl_btn.game_profile:SetText('Игровой профиль')
122-
pl_btn.game_profile.DoClick = function()
123-
RunConsoleCommand('gameprofile_get_player', pl_steamid)
124-
125-
timer.Simple(0.2, function()
126-
FatedGang.menu:Remove()
116+
if GameProfile then
117+
pl_btn.game_profile = vgui.Create('DButton', pl_btn)
118+
Mantle.ui.btn(pl_btn.game_profile, nil, nil, Color(44, 44, 44), 8, true, Color(34, 34, 34))
119+
pl_btn.game_profile:Dock(RIGHT)
120+
pl_btn.game_profile:DockMargin(6, 6, 6, 6)
121+
pl_btn.game_profile:SetWide(140)
122+
pl_btn.game_profile:SetText('Игровой профиль')
123+
pl_btn.game_profile.DoClick = function()
124+
RunConsoleCommand('gameprofile_get_player', pl_steamid)
127125

128-
GameProfile.open_profile(true)
129-
end)
126+
timer.Simple(0.2, function()
127+
FatedGang.menu:Remove()
128+
129+
GameProfile.open_profile(true)
130+
end)
131+
end
130132
end
131133
end
132134
end)

lua/mantle_addons/fatedgang/nets.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ if SERVER then
7474
end
7575

7676
Mantle.notify(pl, Color(102, 49, 138), 'Банды', 'Ваша банда успешно создана!')
77-
GameProfile.add_achievement(pl, 'create_gang', 1)
77+
78+
if GameProfile then
79+
GameProfile.add_achievement(pl, 'create_gang', 1)
80+
end
7881

7982
net.Start('FatedGang-ToClient')
8083
net.WriteString(pl:SteamID())

0 commit comments

Comments
 (0)