Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Episode 2 #292

Merged
merged 80 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
0f4d3ae
ep2_outland_01 mapscript
knoxed May 25, 2024
c625eaa
Start ep2_outland_01a, handle the elevator
ZehMatt May 25, 2024
e1c8257
Merge animations/gestures/postures for kleiner and eli
ZehMatt May 28, 2024
b5c6067
Improve starting part of ep2_outland_01
ZehMatt May 28, 2024
b76f3a3
Add another checkpoint in ep2_outland_01
ZehMatt May 30, 2024
d78c603
Removed the entity from filters, collisions got fixed in dev
ZehMatt Jun 1, 2024
d029948
Get rid of the flashlight sound when there is none
ZehMatt Jun 1, 2024
f6b849d
Shitty improvement to ep2_outland_01
ZehMatt Jun 1, 2024
32fd12e
Add default loadout for each ep2 map script
ZehMatt Jun 1, 2024
e9e3c12
Use a more suitable spawn location during fight
ZehMatt Jun 1, 2024
cdf1e8c
Adjust player spawn for ep2_outland_02
ZehMatt Jun 1, 2024
707b40b
Modify loadout after meeting alyx
ZehMatt Jun 1, 2024
863b965
Handle jalopy
ZehMatt Jun 1, 2024
96e0fa8
Make jalopy work, increase despawn distance
ZehMatt Jun 1, 2024
d86e835
Elevator at the end should wait for players
knoxed Jun 2, 2024
f070f53
Improve outland_01a
knoxed Jun 2, 2024
3f0e000
Add important NPC names to 02
knoxed Jun 2, 2024
965f120
Improve outland_03
knoxed Jun 2, 2024
d22c682
Fix the CI
ZehMatt Jun 2, 2024
44e9d2a
Use correct map order
ZehMatt Jun 2, 2024
0a511e3
Sort of working companion logic, vehicle outputs are still messy
ZehMatt Jun 2, 2024
ead7677
Fix loading a save game messing up dt vars
ZehMatt Jun 2, 2024
f209531
Extend the hull for collision activation check
ZehMatt Jun 2, 2024
57d72f5
Allow the use of conditions for checkpoints specified with data
ZehMatt Jun 2, 2024
0172b01
Improve ep2_outland_02 connecting it to ep2_outland_04
ZehMatt Jun 2, 2024
8a292d9
Correct loadout for ep2_outland_02
ZehMatt Jun 2, 2024
f28ad57
Correct loadout for ep2_outland_01a
ZehMatt Jun 2, 2024
efac588
Allow checkpoints to modify the weapon loadout
ZehMatt Jun 2, 2024
021cd24
Refactor ep2_outland_01a to use checkpoints for loadout modifications
ZehMatt Jun 2, 2024
2343659
Remove special code, change loadout with checkpoints in ep2_outland_02
ZehMatt Jun 2, 2024
be61f80
Fix vehicle despawning with a passenger in it
ZehMatt Jun 2, 2024
8e33186
Fix transitioning alyx, its a hack but it works
ZehMatt Jun 2, 2024
9b6c125
Fix console warnings about unhandled input, its handled
ZehMatt Jun 3, 2024
74e061d
Fix entity i/o surviving a map cleanup
ZehMatt Jun 3, 2024
403563e
Make transitioning of passengers more robust
ZehMatt Jun 3, 2024
12ec9ce
Make passengers enter the vehicle immediately on transitioning
ZehMatt Jun 3, 2024
6bd224f
Handle outputs created by AddOutput, need them for transitioning
ZehMatt Jun 3, 2024
0d3ed0b
Fix clearing the outputs, that was an accident
ZehMatt Jun 3, 2024
8b8fb22
Fix storing outputs not meant to be transitioned
ZehMatt Jun 4, 2024
8ed111a
Fix hints disappearing twice as fast
ZehMatt Jun 7, 2024
31582d1
Refactor a good chunk of vehicle code
ZehMatt Jun 7, 2024
a130930
More vehicle code cleanup
ZehMatt Jun 8, 2024
d806106
Further refactor vehicle code, improve take-over
ZehMatt Jun 8, 2024
37d6150
Fix players taking ownership of ordinary seats/vehicles
ZehMatt Jun 23, 2024
0c68198
Increase vehicle despawn min distance, cleanup
ZehMatt Jun 23, 2024
c6d7c95
Start fixing ep2_outland_07
ZehMatt Jun 23, 2024
959dc97
Fix player ownership being broken, add deny sound
ZehMatt Jun 23, 2024
b75a473
05 mapscript improvements
knoxed Jun 23, 2024
5a13d3e
Prevent starting the vehicle engine if we deny the player
ZehMatt Jun 23, 2024
78f3a4a
06 mapscript improvement
knoxed Jun 23, 2024
8a8edb0
Fix triggers not firing OnStartTouch if team wait is active
ZehMatt Jun 23, 2024
1ae8714
Only teleport players on timeout, random objects could pass the filter
ZehMatt Jun 23, 2024
d4288f2
Add more debug logging on vehicle logic
ZehMatt Jun 23, 2024
bbab062
Resize the trigger that starts the advisor scene, make it team wait
ZehMatt Jun 23, 2024
9796840
GetNWInt returns 0 despite having nil as default, compensate
ZehMatt Jun 23, 2024
ee0ef2d
Autoreload checkpoints, add data driven vehicle checkpoints
ZehMatt Jun 23, 2024
3f84dbe
Make the advisor sounds work, checkpoint
ZehMatt Jul 4, 2024
f5e391c
Fix bad triggers on 06
knoxed Jul 20, 2024
ccf231b
Add cp in power room 06a
knoxed Jul 20, 2024
7a8870e
Add cp before heli fight
knoxed Jul 20, 2024
76f183b
Improved mapscript for 09
knoxed Jul 20, 2024
3fc2362
Added missing combine_dropship anims
knoxed Jul 20, 2024
13ce8a6
Implement TouchTest, StartTouch, EndTouch inputs for triggers
ZehMatt Jul 20, 2024
d6c2abc
Implement MakeMultipleNPCS in npc_template_maker
ZehMatt Jul 21, 2024
9f4074d
Add eli and lamarr anims
knoxed Jul 21, 2024
aee5439
outland_11 mapscript
knoxed Jul 27, 2024
5b93d51
Remove npc clip on _11
knoxed Jul 27, 2024
f4b67e8
Removed lamarr content because it does not work
knoxed Jul 27, 2024
ed1510d
Add a way to remap models, add ep2 advisor model remapping
ZehMatt Jul 29, 2024
739d81a
Add model remapping for ep2 lamarr
ZehMatt Jul 29, 2024
9863148
Fix outputs being cleared on persistent entities
ZehMatt Jul 29, 2024
6fc9527
Fix trigger_changelevel not firing OnChangeLevel output
ZehMatt Jul 30, 2024
809f041
Further delay the change level request, fixes random vorts showing up
ZehMatt Jul 30, 2024
85217a8
Change logic to how vehicles are spawned
ZehMatt Jul 30, 2024
998b118
Stop cleaning up vehicles more often than needed
ZehMatt Jul 30, 2024
e443868
Adjust the map scripts, we rely on the map spawning the vehicle now
ZehMatt Jul 30, 2024
232b68c
Add a better way to control for alyx vehicle entering/exiting
ZehMatt Jul 31, 2024
57f26fe
Fix player collision check, only trace against other players
ZehMatt Aug 6, 2024
fb3f13b
Fixes for maps 11a,11b,12
knoxed Aug 16, 2024
9b80ff3
Last map script and attempt at fixing ending scene
knoxed Aug 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added content/models/Advisor_ep2.dx80.vtx
Binary file not shown.
Binary file added content/models/Advisor_ep2.dx90.vtx
Binary file not shown.
Binary file added content/models/Advisor_ep2.mdl
Binary file not shown.
Binary file added content/models/Advisor_ep2.vvd
Binary file not shown.
Binary file added content/models/Lamarr_ep2.ani
Binary file not shown.
Binary file added content/models/Lamarr_ep2.dx80.vtx
Binary file not shown.
Binary file added content/models/Lamarr_ep2.dx90.vtx
Binary file not shown.
Binary file added content/models/Lamarr_ep2.mdl
Binary file not shown.
Binary file added content/models/Lamarr_ep2.phy
Binary file not shown.
Binary file added content/models/Lamarr_ep2.vvd
Binary file not shown.
Binary file added content/models/advisor_ep2_animations.ani
Binary file not shown.
Binary file added content/models/advisor_ep2_animations.mdl
Binary file not shown.
Binary file added content/models/combine_dropship_animatiep1.ani
Binary file not shown.
Binary file added content/models/combine_dropship_animatiep1.mdl
Binary file not shown.
Binary file added content/models/combine_dropship_animatiep2.ani
Binary file not shown.
Binary file added content/models/combine_dropship_animatiep2.mdl
Binary file not shown.
Binary file added content/models/combine_dropship_animatihl2.ani
Binary file not shown.
Binary file added content/models/combine_dropship_animatihl2.mdl
Binary file not shown.
Binary file added content/models/combine_dropship_animations.mdl
Binary file not shown.
Binary file added content/models/eli_anep1.ani
Binary file not shown.
Binary file added content/models/eli_anep1.mdl
Binary file not shown.
Binary file added content/models/eli_anep2.ani
Binary file not shown.
Binary file added content/models/eli_anep2.mdl
Binary file not shown.
Binary file added content/models/eli_anhl2.ani
Binary file not shown.
Binary file added content/models/eli_anhl2.mdl
Binary file not shown.
Binary file added content/models/eli_anims.mdl
Binary file not shown.
Binary file added content/models/eli_gestuep1.ani
Binary file not shown.
Binary file added content/models/eli_gestuep1.mdl
Binary file not shown.
Binary file added content/models/eli_gestuep2.ani
Binary file not shown.
Binary file added content/models/eli_gestuep2.mdl
Binary file not shown.
Binary file added content/models/eli_gestuhl2.ani
Binary file not shown.
Binary file added content/models/eli_gestuhl2.mdl
Binary file not shown.
Binary file added content/models/eli_gestures.mdl
Binary file not shown.
Binary file added content/models/eli_postuep1.ani
Binary file not shown.
Binary file added content/models/eli_postuep1.mdl
Binary file not shown.
Binary file added content/models/eli_postuep2.ani
Binary file not shown.
Binary file added content/models/eli_postuep2.mdl
Binary file not shown.
Binary file added content/models/eli_postuhl2.ani
Binary file not shown.
Binary file added content/models/eli_postuhl2.mdl
Binary file not shown.
Binary file added content/models/eli_postures.mdl
Binary file not shown.
Binary file added content/models/kleiner_animatiep1.ani
Binary file not shown.
Binary file added content/models/kleiner_animatiep1.mdl
Binary file not shown.
Binary file added content/models/kleiner_animatiep2.ani
Binary file not shown.
Binary file added content/models/kleiner_animatiep2.mdl
Binary file not shown.
Binary file added content/models/kleiner_animatihl2.ani
Binary file not shown.
Binary file added content/models/kleiner_animatihl2.mdl
Binary file not shown.
Binary file added content/models/kleiner_animations.mdl
Binary file not shown.
Binary file added content/models/kleiner_gestuep1.ani
Binary file not shown.
Binary file added content/models/kleiner_gestuep1.mdl
Binary file not shown.
Binary file added content/models/kleiner_gestuep2.ani
Binary file not shown.
Binary file added content/models/kleiner_gestuep2.mdl
Binary file not shown.
Binary file added content/models/kleiner_gestuhl2.ani
Binary file not shown.
Binary file added content/models/kleiner_gestuhl2.mdl
Binary file not shown.
Binary file added content/models/kleiner_gestures.mdl
Binary file not shown.
Binary file added content/models/kleiner_postuep1.ani
Binary file not shown.
Binary file added content/models/kleiner_postuep1.mdl
Binary file not shown.
Binary file added content/models/kleiner_postuep2.ani
Binary file not shown.
Binary file added content/models/kleiner_postuep2.mdl
Binary file not shown.
Binary file added content/models/kleiner_postuhl2.ani
Binary file not shown.
Binary file added content/models/kleiner_postuhl2.mdl
Binary file not shown.
Binary file added content/models/kleiner_postures.mdl
Binary file not shown.
5 changes: 2 additions & 3 deletions entities/entities/env_zoom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@ end

function ENT:AcceptInput(fn, data, activator, caller)
DbgPrint(self, fn, data, activator, caller)
BaseClass.AcceptInput(self, fn, data, activator, caller)
return BaseClass.AcceptInput(self, fn, data, activator, caller)
end

function ENT:KeyValue(key, val)
BaseClass.KeyValue(self, key, val)

if key:iequals("rate") then
self.Rate = val
elseif key:iequals("fov") then
self.FOV = val
end
return BaseClass.KeyValue(self, key, val)
end

function ENT:ZoomPlayer(ply)
Expand Down
6 changes: 6 additions & 0 deletions entities/entities/lambda_checkpoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,20 @@ function ENT:Think()
end
end

-- TODO: Remove all instances, use SetRenderPos
function ENT:SetVisiblePos(pos)
self:SetNWVector("VisiblePos", pos)
end

ENT.SetRenderPos = ENT.SetVisiblePos

-- TODO: Remove all instances, use GetRenderPos
function ENT:GetVisiblePos()
return self:GetNWVector("VisiblePos", self:GetPos())
end

ENT.GetRenderPos = ENT.GetVisiblePos

function ENT:SetDynamicCheckpoint(dynamic)
self:SetNWBool("DynamicCheckpoint", dynamic)
end
Expand Down
8 changes: 8 additions & 0 deletions entities/entities/lambda_entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ function ENT:SetupNWVar(key, dtType, data)
end
end

function ENT:OnRestore()
-- Adjust the Get/Set functions, functions can not be serialized.
for k, v in pairs(self.DTVarTable) do
v.Get = DTVAR_GET[v.Type]
v.Set = DTVAR_SET[v.Type]
end
end

function ENT:GetNWVar(key, fallback)
if self.DTVarTable == nil then return fallback end
local dtVar = self.DTVarTable[key]
Expand Down
55 changes: 45 additions & 10 deletions entities/entities/lambda_trigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ if SERVER then
self:SetupOutput("OnStartTouchAll")
self:SetupOutput("OnEndTouch")
self:SetupOutput("OnEndTouchAll")
self:SetupOutput("OnTouching")
self:SetupOutput("OnNotTouching")
self:SetInputFunction("Enable", self.Enable)
self:SetInputFunction("Disable", self.Disable)
self:SetInputFunction("Toggle", self.Toggle)
self:SetInputFunction("TouchTest", self.TouchTest)
self:SetInputFunction("StartTouch", self.InputStartTouch)
self:SetInputFunction("EndTouch", self.InputEndTouch)

self:SetupNWVar("Disabled", "bool", {
Default = false,
Expand Down Expand Up @@ -121,6 +126,8 @@ if SERVER then
self.DisabledTouchingObjects = {}
self.TouchingObjects = {}
self.LastTouch = CurTime()
self.PendingStartTouch = false

self:AddDebugOverlays(bit.bor(OVERLAY_PIVOT_BIT, OVERLAY_BBOX_BIT, OVERLAY_NAME_BIT))
end

Expand Down Expand Up @@ -316,6 +323,27 @@ if SERVER then
end
end

function ENT:TouchTest()
DbgPrint(self, "ENT:TouchTest")
if table.Count(self.TouchingObjects) == 0 then
self:FireOutputs("OnNotTouching", nil, nil)
else
self:FireOutputs("OnTouching", nil, nil)
end
end

function ENT:InputStartTouch(data, activator, caller)
DbgPrint(self, "ENT:InputStartTouch")
if not IsValid(caller) then return end
self:StartTouch(caller)
end

function ENT:InputEndTouch(data, activator, caller)
DbgPrint(self, "ENT:InputEndTouch")
if not IsValid(caller) then return end
self:EndTouch(caller)
end

function ENT:GetTimeout()
local timeout = self:GetNWVar("Timeout", 0)
if timeout ~= 0 then return timeout end
Expand Down Expand Up @@ -458,7 +486,8 @@ if SERVER then
--DbgPrint(self, "OnTriggerEvents: " .. #self.OnTriggerEvents)
local timeoutEvent = false

if self:GetNWVar("WaitForTeam") == true then
local isTeamWait = self:GetNWVar("WaitForTeam")
if isTeamWait == true then
--DbgPrint("Waiting")
if self.TeamInside == false then
if self.NextTimeout == 0 then
Expand Down Expand Up @@ -486,6 +515,15 @@ if SERVER then
self.OnTrigger(self, ent)
end

if isTeamWait and self.PendingStartTouch == true then
DbgPrint(self, "Firing pending StartTouch")

-- We also have to fire StartTouch because if teamwait is set it will not fire it in StartTouch.
self:FireOutputs("OnStartTouch", nil, ent)

self.PendingStartTouch = false
end

self:FireOutputs("OnTrigger", nil, ent)

if waitTime < 0 then
Expand Down Expand Up @@ -518,21 +556,15 @@ if SERVER then
function ENT:TeleportAllToTrigger()
local missingEnts = {}

for _, v in pairs(ents.GetAll()) do
for _, v in pairs(util.GetAllPlayers()) do
if not self:IsEntityTouching(v) and self:PassesTriggerFilters(v) then
local isAlive = true

if v:IsPlayer() then
isAlive = v:Alive()
end

if isAlive then
if v:Alive() then
table.insert(missingEnts, v)
end
end
end

-- Teleport missing objects into the box
-- Teleport missing players into the box.
local centerPos = Vector(0, 0, 0)
local numEntries = 0

Expand Down Expand Up @@ -633,6 +665,9 @@ if SERVER then
if waitForTeam == false or (waitForTeam == true and self.TeamInside == true) then
DbgPrint(self, CurTime() .. ", OnStartTouch")
self:FireOutputs("OnStartTouch", nil, ent)
else
DbgPrint(self, "Delaying StartTouch until condition is met")
self.PendingStartTouch = true
end

if table.Count(self.TouchingObjects) == 1 then
Expand Down
128 changes: 128 additions & 0 deletions entities/entities/lambda_vehicle_companion.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
local DbgPrint = GetLogging("Vehicle")

ENT.Base = "lambda_entity"
ENT.Type = "point"
DEFINE_BASECLASS("lambda_entity")

function ENT:PreInitialize()
BaseClass.PreInitialize(self)
DbgPrint(self, "PreInitialize")
self:SetInputFunction("OnPlayerVehicleEnter", self.InputOnPlayerVehicleEnter)
self:SetInputFunction("OnPlayerVehicleExit", self.InputOnPlayerVehicleExit)
self:SetupNWVar(
"CompanionName",
"string",
{
Default = "",
KeyValue = "CompanionName"
}
)
end

function ENT:Initialize()
BaseClass.Initialize(self)
DbgPrint(self, "Initialize")
end

local function IsEntityInVehicle(ent)
if not IsValid(ent) then
return false
end

if ent:IsPlayer() then
return ent:InVehicle()
end

if ent:IsNPC() then
-- This is a bit akward.
local parent = ent:GetParent()
if IsValid(parent) and parent:IsVehicle() then
return true
end
end

return false
end

local function IsEntityBusy(ent)
if not IsValid(ent) then
return false
end

if ent:IsNPC() then
local npcState = ent:GetNPCState()
if npcState == NPC_STATE_SCRIPT or npcState == NPC_STATE_DEAD or npcState == NPC_STATE_PLAYDEAD then
return true
end
end

return false
end

function ENT:InputOnPlayerVehicleEnter(data, activator, caller)
DbgPrint(self, "InputOnPlayerVehicleEnter", tostring(data), tostring(activator), tostring(caller))

local passenger = GAMEMODE:VehicleGetPassenger(caller)
if IsValid(passenger) then
-- Already holds a passenger.
DbgPrint("Vehicle already has a passenger")
return
end

local companionName = self:GetNWVar("CompanionName")
local closest = nil
local closestDist = 999999
for _, v in pairs(ents.FindByName(companionName)) do
local dist = v:GetPos():Distance(caller:GetPos())
if dist < closestDist then
closest = v
closestDist = dist
end
end

if not IsValid(closest) then
DbgPrint("Unable to find companion '" .. companionName .. "'")
return
end

if IsEntityInVehicle(closest) then
DbgPrint("Companion is already in a vehicle")
return
end

if IsEntityBusy(closest) then
DbgPrint("Companion is busy")
return
end

local oldName = activator:GetName()
local newName = "lambda_vehicle_companion_" .. tostring(activator:EntIndex())
caller:SetName(newName)
DbgPrint("Requesting '" .. companionName .. "' to enter vehicle")
closest:Input("EnterVehicle", activator, self, newName)
caller:SetName(oldName)
end

function ENT:InputOnPlayerVehicleExit(data, activator, caller)
DbgPrint(self, "InputOnPlayerVehicleExit", tostring(data), tostring(activator), tostring(caller))
if not IsValid(caller) or not IsValid(activator) then
return
end

-- Check if the vehicle has a NPC companion.
local passenger = GAMEMODE:VehicleGetPassenger(caller)
if not IsValid(passenger) then
return
end

DbgPrint("Requesting companion to leave vehicle.")
passenger:Input("ExitVehicle", activator, self)
end

function ENT:UpdateTransmitState()
return TRANSMIT_NEVER
end

function ENT:OnRemove()
DbgPrint(self, "OnRemove")
end
9 changes: 4 additions & 5 deletions entities/entities/lambda_vehicle_tracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ function ENT:Initialize()
end

self:DrawShadow(false)
--self:AddEffects(EF_NODRAW)
end

function ENT:AttachToVehicle(vehicle)
self:SetModel(vehicle:GetModel())
self:SetPos(vehicle:GetPos())
self:SetAngles(vehicle:GetAngles())
self:SetParent(vehicle)
--self:AddEffects(EF_NODRAW)
self:DrawShadow(false)
self.Vehicle = vehicle
self.Player = vehicle.LambdaPlayer
self.Player = GAMEMODE:VehicleGetPlayerOwner(vehicle)
self:SetNWEntity("LambdaVehicleOwner", self.Player)
self:SetNWBool("LambdaVehicleTaken", IsValid(self.Player))
end
Expand All @@ -50,8 +48,9 @@ if SERVER then
return
end

if self.Player ~= vehicle.LambdaPlayer then
self.Player = vehicle.LambdaPlayer
local vehicleOwner = GAMEMODE:VehicleGetPlayerOwner(vehicle)
if self.Player ~= vehicleOwner then
self.Player = vehicleOwner
self:SetNWEntity("LambdaVehicleOwner", self.Player)
self:SetNWBool("LambdaVehicleTaken", IsValid(self.Player))
DbgPrint("Owner changed")
Expand Down
2 changes: 2 additions & 0 deletions entities/entities/logic_auto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ end
function ENT:Enable()
self:SetNWVar("Disabled", false)
self:NextThink(CurTime())
return true
end

function ENT:Disable()
self:SetNWVar("Disabled", true)
return true
end

function ENT:UpdateTransmitState()
Expand Down
12 changes: 10 additions & 2 deletions entities/entities/npc_template_maker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,16 @@ function ENT:MakeNPCInLine()
self:UpdateScaling()
end

function ENT:MakeMultipleNPCS()
Error("MakeMultipleNPCS not implemented")
function ENT:MakeMultipleNPCS(data)
local numNpcs = tonumber(data)
local inRadius = self.DestinationGroup ~= nil and self.Radius > 0.1
for i = 1, numNpcs do
if inRadius then
self:MakeNPCInRadius()
else
self:MakeNPC()
end
end
end

function ENT:ChangeDestinationGroup(data)
Expand Down
4 changes: 3 additions & 1 deletion entities/entities/player_speedmod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ function ENT:AcceptInput(inputName, activator, called, data)
local speed = tonumber(data)

for _, v in pairs(util.GetAllPlayers()) do
v:Flashlight(false)
if v:FlashlightIsOn() then
v:Flashlight(false)
end
v:SetLaggedMovementValue(speed)
end

Expand Down
Loading