From 8ae011d8d093a6668a8f10f58bf09a2bbfa38dea Mon Sep 17 00:00:00 2001 From: Benjamin Leber Date: Thu, 10 Sep 2026 19:03:46 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=92=9A=20Add=20local=20ai=20stuff=20t?= =?UTF-8?q?o=20gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9c4ce71..87f6208 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ *.zip /.idea/ -*.iml \ No newline at end of file +*.iml + +.ai-sandbox.json +.claude/settings.local.json From 06294dc419aeffbb8bd957a2ae61cd8e59106684 Mon Sep 17 00:00:00 2001 From: Benjamin Leber Date: Thu, 10 Sep 2026 19:11:05 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=91=20No=20longer=20set=20current?= =?UTF-8?q?=20vehicle=20of=20vdTelemetry=20when=20not=20controlling=20play?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AI.lua | 1 + AISpec.lua | 37 ++++++++++++++++++++++++++++--------- modDesc.xml | 8 +++++++- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/AI.lua b/AI.lua index f07f273..37f6fa9 100644 --- a/AI.lua +++ b/AI.lua @@ -4,6 +4,7 @@ -- @history v1.0.0.0 - 2025-03-23 - Initial implementation -- v1.1.0.0 - 2026-07-03 - Rename vd telemetry, expose implement functions on vehicle / implement -- v1.2.0.0 - 2026-08-24 - Expose implement functions addressed at the selected machine +-- v1.2.1.0 - 2026-09-10 - Fix vdTelemetry integration reacting to other players in multiplayer -- @Description: Registers additional input bindings -- @web: https://grisu118.ch or https://vertexdezign.net -- Copyright (C) Grisu118, All Rights Reserved. diff --git a/AISpec.lua b/AISpec.lua index 53c5369..c5f8527 100644 --- a/AISpec.lua +++ b/AISpec.lua @@ -56,23 +56,42 @@ function AdditionalInputsSpec:onLoad(savegame) self.spec_additionalInputs.debugger:trace("onLoad") end +---Called when a player enters this vehicle. +---In multiplayer this is raised on every client for every player, so it also fires for +---remote players entering their own vehicles. isControlling is only true for the local +---player, everyone else must be ignored. +---@param isControlling boolean true if the local player is the one controlling the vehicle function AdditionalInputsSpec:onEnterVehicle(isControlling) - if g_vdTelemetry ~= nil then - local spec = self.spec_additionalInputs - spec.debugger:trace(function() - return "onEnterVehicle(" .. tostring(isControlling) .. ")" - end) + local spec = self.spec_additionalInputs + spec.debugger:trace(function() + return "onEnterVehicle(" .. tostring(isControlling) .. ")" + end) + if not isControlling then + return + end + + if g_vdTelemetry ~= nil then g_vdTelemetry:setCurrentVehicle(self) end end +---Called when a player leaves this vehicle. +---Same multiplayer semantics as onEnterVehicle: raised on every client for every player, +---and additionally when a vehicle occupied by someone else is deleted or its player +---disconnects. wasEntered is only true if the local player was the one inside. +---@param wasEntered boolean true if the local player was controlling the vehicle function AdditionalInputsSpec:onLeaveVehicle(wasEntered) + local spec = self.spec_additionalInputs + spec.debugger:trace(function() + return "onLeaveVehicle(" .. tostring(wasEntered) .. ")" + end) + + if not wasEntered then + return + end + if g_vdTelemetry ~= nil then - local spec = self.spec_additionalInputs - spec.debugger:trace(function() - return "onLeaveVehicle(" .. tostring(wasEntered) .. ")" - end) g_vdTelemetry:clearCurrentVehicle() end end diff --git a/modDesc.xml b/modDesc.xml index 65c8bff..299b65f 100644 --- a/modDesc.xml +++ b/modDesc.xml @@ -1,7 +1,7 @@  VertexDezign - 1.2.0.0 + 1.2.1.0 <en>Additional Inputs</en> <de>Zusätzliche Eingaben</de> @@ -49,6 +49,9 @@ Please report feedback or issues on Github. GitHub link: https://github.com/VertexDezign/AdditionalInputs Changelog: +1.2.1.0: +* Fix multiplayer issue where the vdTelemetry integration reacted to other players entering or leaving their vehicles + 1.2.0.0: * Add public API to fold, lower and activate the currently selected machine @@ -99,6 +102,9 @@ Bitte melden Sie Feedback oder Probleme auf Github. GitHub-Link: https://github.com/VertexDezign/AdditionalInputs Changelog: +1.2.1.0: +* Mehrspieler-Fehler behoben, bei dem die vdTelemetry-Anbindung auf andere Spieler reagierte, die ihre Fahrzeuge betraten oder verliessen + 1.2.0.0: * API hinzugefügt, um die aktuell ausgewählte Maschine ein-/auszuklappen, zu heben/senken und zu aktivieren