diff --git a/gamemode/sh_vehicles.lua b/gamemode/sh_vehicles.lua index 4f0fdccb..54d01b3c 100644 --- a/gamemode/sh_vehicles.lua +++ b/gamemode/sh_vehicles.lua @@ -77,9 +77,11 @@ if SERVER then end -- Akward hack to know if an NPC passenger is inside. We handle this with our AcceptInput hook. + self.IsCreatingInternalOutputs = true vehicle:Input("AddOutput", NULL, NULL, "OnCompanionEnteredVehicle !self,LambdaCompanionEnteredVehicle,,0,-1") vehicle:Input("AddOutput", NULL, NULL, "OnCompanionExitedVehicle !self,LambdaCompanionExitedVehicle,,1,-1") - + self.IsCreatingInternalOutputs = false + -- We only get a model next frame, delay it. util.RunNextFrame(function() if not IsValid(vehicle) then return end diff --git a/gamemode/sv_inputoutput.lua b/gamemode/sv_inputoutput.lua index 345f4003..681c1e54 100644 --- a/gamemode/sv_inputoutput.lua +++ b/gamemode/sv_inputoutput.lua @@ -72,14 +72,14 @@ function GM:AcceptInput(ent, inputName, activator, caller, value) end -- Deal with AddOutput. - if inputName == "AddOutput" then + if inputName == "AddOutput" and self.IsCreatingInternalOutputs ~= true then -- Split outputname and output parameters. local outputName, outputParams = string.match(value, "(%w+)%s+(.*)") -- AddOutput uses double point instead of comma, replace that. outputParams = string.gsub(outputParams, ":", ",") - print(ent, "AddOutput", outputName, outputParams) + DbgPrint("Handling AddOutput", ent, outputName, outputParams) ent.EntityOutputs = ent.EntityOutputs or {} local outputs = ent.EntityOutputs[outputName] or {}