Skip to content

Commit 961445b

Browse files
author
Garrus2142
committed
Merge branch 'dev' into experimental
2 parents ea4e8d5 + 62bcec3 commit 961445b

File tree

10 files changed

+67
-57
lines changed

10 files changed

+67
-57
lines changed

entities/weapons/weapon_alertropes/cl_init.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- @Author: Vyn
44
-- @Date: 2017-07-26 14:08:23
55
-- @Last Modified by: Vyn
6-
-- @Last Modified time: 2017-07-26 15:20:13
6+
-- @Last Modified time: 2017-07-27 18:27:04
77

88
include("shared.lua")
99

@@ -75,7 +75,9 @@ function SWEP:GetViewModelPosition(pos, ang)
7575
end
7676

7777
function SWEP:DrawWorldModel()
78-
local hand_pos = self.Owner:GetBonePosition(self.Owner:LookupBone("ValveBiped.Bip01_R_Hand"))
78+
local bone = self.Owner:LookupBone("ValveBiped.Bip01_R_Hand")
79+
if !bone then return end
80+
local hand_pos = self.Owner:GetBonePosition(bone)
7981
local hand_ang = Angle(self.Owner:EyeAngles().pitch + 180, self.Owner:EyeAngles().yaw - 30, 0)
8082
hand_pos = hand_pos + hand_ang:Forward() * -3 + hand_ang:Right() * -2
8183
self:SetRenderOrigin(hand_pos)

entities/weapons/weapon_beartrap/cl_init.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- @Author: Vyn
44
-- @Date: 2017-07-26 14:11:41
55
-- @Last Modified by: Vyn
6-
-- @Last Modified time: 2017-07-26 15:20:54
6+
-- @Last Modified time: 2017-07-27 18:26:23
77

88
include("shared.lua")
99

@@ -76,7 +76,9 @@ function SWEP:GetViewModelPosition(pos, ang)
7676
end
7777

7878
function SWEP:DrawWorldModel()
79-
local hand_pos = self.Owner:GetBonePosition(self.Owner:LookupBone("ValveBiped.Bip01_R_Hand"))
79+
local bone = self.Owner:LookupBone("ValveBiped.Bip01_R_Hand")
80+
if !bone then return end
81+
local hand_pos = self.Owner:GetBonePosition(bone)
8082
local hand_ang = Angle(self.Owner:EyeAngles().pitch + 90, self.Owner:EyeAngles().yaw - 30, 0)
8183
hand_pos = hand_pos + hand_ang:Up() * 3 + hand_ang:Right() * -4
8284
self:SetRenderOrigin(hand_pos)

entities/weapons/weapon_dooraxe/cl_init.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- @Author: Vyn
44
-- @Date: 2017-07-26 14:09:54
55
-- @Last Modified by: Vyn
6-
-- @Last Modified time: 2017-07-26 15:21:11
6+
-- @Last Modified time: 2017-07-27 18:26:44
77

88
include("shared.lua")
99

@@ -95,7 +95,9 @@ function SWEP:GetViewModelPosition(pos, ang)
9595
end
9696

9797
function SWEP:DrawWorldModel()
98-
local hand_pos = self.Owner:GetBonePosition(self.Owner:LookupBone("ValveBiped.Bip01_R_Hand"))
98+
local bone = self.Owner:LookupBone("ValveBiped.Bip01_R_Hand")
99+
if !bone then return end
100+
local hand_pos = self.Owner:GetBonePosition(bone)
99101
local hand_ang = Angle(self.Owner:EyeAngles().pitch + 180, self.Owner:EyeAngles().yaw - 30, 0)
100102
hand_pos = hand_pos + hand_ang:Forward() * -3 + hand_ang:Right() * -7
101103
self:SetRenderOrigin(hand_pos)

gamemode/cl_init.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
-- @Author: Garrus2142
44
-- @Date: 2017-07-25 16:15:45
55
-- @Last Modified by: Garrus2142
6-
-- @Last Modified time: 2017-07-26 14:49:26
6+
-- @Last Modified time: 2017-07-27 17:08:44
77

8-
include("config.lua")
98
include("shared.lua")
9+
include("config.lua")
1010
include("core/_includes.lua")
11+
include("modulesloader.lua")
1112

1213
local hide = {
1314
CHudHealth = true,
@@ -37,6 +38,4 @@ end
3738

3839
function GM:DrawDeathNotice(x, y)
3940

40-
end
41-
42-
LoadModules()
41+
end

gamemode/core/slot/sv_slotcheck.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
-- The gamemode CANNOT handle more than 10 players !
1010
hook.Add( "CheckPassword", "max_players", function( steamID64, ipAddress, svPassword, clPassword, name )
11-
if player.GetCount() >= 10 then
11+
if #player.GetAll() >= 10 then
1212
return false, "Server is full."
1313
end
1414
end )

gamemode/init.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
-- @Author: Garrus2142
44
-- @Date: 2017-07-25 16:15:48
55
-- @Last Modified by: Garrus2142
6-
-- @Last Modified time: 2017-07-26 14:49:46
6+
-- @Last Modified time: 2017-07-27 17:09:45
77

88
DEFINE_BASECLASS( "gamemode_base" )
9-
include("config.lua")
109
include("shared.lua")
10+
include("config.lua")
1111
include("libs/zones.lua")
1212
include("core/_includes.lua")
13+
include("modulesloader.lua")
1314
AddCSLuaFile("cl_init.lua")
1415
AddCSLuaFile("shared.lua")
1516
AddCSLuaFile("config.lua")
1617
AddCSLuaFile("core/_includes.lua")
18+
AddCSLuaFile("modulesloader.lua")
1719

1820
GAME_LUM = "g"
1921

@@ -38,6 +40,4 @@ end
3840
-- Fall damage
3941
function GM:GetFallDamage( ply, speed )
4042
return ( speed / 8 )
41-
end
42-
43-
LoadModules()
43+
end

gamemode/modules/observer/sv_observer.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- @Author: Garrus2142
44
-- @Date: 2017-07-25 16:15:50
55
-- @Last Modified by: Garrus2142
6-
-- @Last Modified time: 2017-07-26 14:48:43
6+
-- @Last Modified time: 2017-07-27 18:08:05
77

88
local GM = GM or GAMEMODE
99

@@ -113,16 +113,18 @@ local function KeyPress( ply, key )
113113
end
114114
hook.Add("KeyPress", "sls_observer_KeyPress", KeyPress)
115115

116-
-- Doesn't work today
117-
/*local function PlayerInitialSpawn(ply)
118-
timer.Simple(3, function()
116+
local function PlayerInitialSpawn(ply)
117+
timer.Simple(15, function()
119118
if IsValid(ply) && !ply:Alive() && GM.ROUND.Active then
120119
for _, v in ipairs(GM.ROUND.Survivors) do
121120
if v:Alive() then
121+
net.Start("sls_round_Camera")
122+
net.WriteBool(false)
123+
net.Broadcast()
122124
SpectatePlayer(ply, v)
123125
end
124126
end
125127
end
126128
end)
127129
end
128-
hook.Add("PlayerInitialSpawn", "sls_round_PlayerInitialSpawn", PlayerInitialSpawn)*/
130+
hook.Add("PlayerInitialSpawn", "sls_round_PlayerInitialSpawn", PlayerInitialSpawn)

gamemode/modules/stamina/sh_stamina.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
--
33
-- @Author: Guilhem PECH
44
-- @Date: 2017-07-26T13:54:42+02:00
5-
-- @Last Modified by: Guilhem PECH
6-
-- @Last Modified time: 2017-07-27 11:52:08
5+
-- @Last Modified by: Garrus2142
6+
-- @Last Modified time: 2017-07-27 18:08:23
77

88

99

@@ -214,7 +214,7 @@ if CLIENT then
214214
local ply = LocalPlayer()
215215
local bwide
216216
if ply:Team() != TEAM_SURVIVORS || !ply:Alive() then return end
217-
if ply.ClassID == nil || ply.ClassID == CLASS_SURV_SPORTS then return end
217+
--if ply.ClassID == nil || ply.ClassID == CLASS_SURV_SPORTS then return end
218218
if !ply.ClassID || !GAMEMODE.ROUND.Active || !GAMEMODE.CLASS.Survivors[ply.ClassID].stamina then return end
219219
bwide = 256 * ply.Stamina / GAMEMODE.CLASS.Survivors[ply.ClassID].stamina
220220
if ply.Stamina == GAMEMODE.CLASS.Survivors[ply.ClassID].stamina && alpha_stamina > 0 then

gamemode/modulesloader.lua

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-- Utopia Games - Slashers
2+
--
3+
-- @Author: Garrus2142
4+
-- @Date: 2017-07-27 17:07:04
5+
-- @Last Modified by: Garrus2142
6+
-- @Last Modified time: 2017-07-27 17:07:59
7+
8+
local modulesPath = "slashers/gamemode/modules"
9+
local _, directories = file.Find(modulesPath .. "/*", "LUA")
10+
11+
if SERVER then print("--- MODULES ---") end
12+
for _, mod in ipairs(directories) do
13+
if GM.CONFIG["disabled_modules"][mod] then continue end
14+
files = file.Find(modulesPath .. "/" .. mod .. "/*.lua", "LUA")
15+
if #files > 0 then
16+
if SERVER then print("LOADING " .. mod) end
17+
end
18+
for _, v in ipairs(files) do
19+
local ext = string.sub(v, 1, 3)
20+
if ext == "cl_" || ext == "sh_" then
21+
if SERVER then
22+
AddCSLuaFile(modulesPath .. "/" .. mod .. "/" .. v)
23+
else
24+
include(modulesPath .. "/" .. mod .. "/" .. v)
25+
end
26+
end
27+
if ext == "sv_" || ext == "sh_" then
28+
if SERVER then
29+
include(modulesPath .. "/" .. mod .. "/" .. v)
30+
end
31+
end
32+
end
33+
end

gamemode/shared.lua

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- @Author: Garrus2142
44
-- @Date: 2017-07-25 16:15:52
55
-- @Last Modified by: Garrus2142
6-
-- @Last Modified time: 2017-07-26 14:49:51
6+
-- @Last Modified time: 2017-07-27 17:08:04
77

88
GM.Name = "Slashers";
99
GM.Author = "Garrus2142";
@@ -30,34 +30,4 @@ CLASS_KILL_PROXY = 104
3030
CLASS_KILL_INTRUDER = 105
3131

3232
team.SetUp(TEAM_KILLER, "Murderer", Color(255, 0, 0), false);
33-
team.SetUp(TEAM_SURVIVORS, "Survivors", Color(0, 0, 255), false);
34-
35-
-- Module Loader
36-
function LoadModules()
37-
local modulesPath = "slashers/gamemode/modules"
38-
local _, directories = file.Find(modulesPath .. "/*", "LUA")
39-
40-
if SERVER then print("--- MODULES ---") end
41-
for _, mod in ipairs(directories) do
42-
if GM.CONFIG["disabled_modules"][mod] then continue end
43-
files = file.Find(modulesPath .. "/" .. mod .. "/*.lua", "LUA")
44-
if #files > 0 then
45-
if SERVER then print("LOADING " .. mod) end
46-
end
47-
for _, v in ipairs(files) do
48-
local ext = string.sub(v, 1, 3)
49-
if ext == "cl_" || ext == "sh_" then
50-
if SERVER then
51-
AddCSLuaFile(modulesPath .. "/" .. mod .. "/" .. v)
52-
else
53-
include(modulesPath .. "/" .. mod .. "/" .. v)
54-
end
55-
end
56-
if ext == "sv_" || ext == "sh_" then
57-
if SERVER then
58-
include(modulesPath .. "/" .. mod .. "/" .. v)
59-
end
60-
end
61-
end
62-
end
63-
end
33+
team.SetUp(TEAM_SURVIVORS, "Survivors", Color(0, 0, 255), false);

0 commit comments

Comments
 (0)