16 Commits

Author SHA256 Message Date
b776cd82c7 Accepting request 1298909 from games
- Fix GLM build errors (https://github.com/daid/EmptyEpsilon/issues/2111)

OBS-URL: https://build.opensuse.org/request/show/1298909
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/emptyepsilon?expand=0&rev=7
2025-08-12 15:03:57 +00:00
9120aa2d5e cr
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=38
2025-08-11 16:20:13 +00:00
2477c5a75d cr
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=37
2025-08-11 16:18:51 +00:00
6a4bfdd666 Don't overwrite %optflags
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=36
2025-08-11 16:18:03 +00:00
e9093baadb - Fix GLM build errors (https://github.com/daid/EmptyEpsilon/issues/2111)
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=35
2025-08-11 11:34:35 +00:00
74b90c94a6 Accepting request 1271501 from games
OBS-URL: https://build.opensuse.org/request/show/1271501
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/emptyepsilon?expand=0&rev=6
2025-04-22 15:30:01 +00:00
bd7384e8f7 - Use BuildRequires pkgconfig(sdl2) instead sdl2-devel, fixes
building for Leap

OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=33
2025-04-22 09:21:21 +00:00
7102efcf7b Accepting request 1266535 from games
- Load use_bundled_basis_universal.patch as source as %autopatch
  doesn't have the -m option on 15.6
- Backport patches for Lua API fixes:
  * lua_add_getCurrentWarpSpeed.patch
  * lua_fix_multivar.patch
  * lua_add_commandBypassSelfDestruct.patch
  * lua_fix_commandCombatManeuver.patch

OBS-URL: https://build.opensuse.org/request/show/1266535
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/emptyepsilon?expand=0&rev=5
2025-04-02 15:17:53 +00:00
f2dd792d26 - Load use_bundled_basis_universal.patch as source as %autopatch
doesn't have the -m option on 15.6

OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=31
2025-04-01 09:48:54 +00:00
4ad5699ffa * lua_add_commandBypassSelfDestruct.patch
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=30
2025-04-01 09:40:46 +00:00
7948b94b12 - Backport patches for Lua API fixes:
* lua_add_getCurrentWarpSpeed.patch
  * lua_fix_multivar.patch
  * lua_fix_commandCombatManeuver.patch

OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=29
2025-04-01 09:24:50 +00:00
f711a7e885 - Backport current_warp.patch and lua_multivar.patch
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=28
2025-03-30 21:35:32 +00:00
ac823dc2af Accepting request 1237732 from games
- Version 2024.12.08
  * Remove 'f' suffix from numbers in lua (#2164)
  * Some minor de updates
  * fix minor typo
  * more minor de updates

OBS-URL: https://build.opensuse.org/request/show/1237732
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/emptyepsilon?expand=0&rev=4
2025-01-14 15:23:51 +00:00
b377e96dc2 Fix build and deduplicate
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=26
2025-01-10 21:33:02 +00:00
1ec155ca0d Fix icon and desktop file name
OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=25
2025-01-10 21:16:50 +00:00
c2c747310a - Version 2024.12.08
* Remove 'f' suffix from numbers in lua (#2164)
  * Some minor de updates
  * fix minor typo
  * more minor de updates

OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=24
2025-01-10 21:08:22 +00:00
10 changed files with 331 additions and 20 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94e20a79e08e97213d0add936fe3caa1a6f79d8ad1495d73f476b52b91ea5531
size 261106883

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8be5360270b9a616a5d749aec9653b3e36beba96b2d6b1651e18594a3314f010
size 261708187

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ff8762016eacf18620ff4f9513462231b1f2c9819127d8aebbdea05c149c1db3
size 2648726

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fa4a9873c5f8872f9f2d75d03eec06c8a40ea2e0daeb977f0445f14c1e76a236
size 2648907

View File

@@ -1,3 +1,38 @@
-------------------------------------------------------------------
Mon Aug 11 11:16:25 UTC 2025 - Dominik Heidler <dheidler@suse.de>
- Fix GLM build errors (https://github.com/daid/EmptyEpsilon/issues/2111)
-------------------------------------------------------------------
Mon Apr 21 15:40:07 UTC 2025 - Carsten Ziepke <kieltux@gmail.com>
- Use BuildRequires pkgconfig(sdl2) instead sdl2-devel, fixes
building for Leap
-------------------------------------------------------------------
Tue Apr 1 09:45:21 UTC 2025 - Dominik Heidler <dheidler@suse.de>
- Load use_bundled_basis_universal.patch as source as %autopatch
doesn't have the -m option on 15.6
-------------------------------------------------------------------
Sun Mar 30 21:34:36 UTC 2025 - Dominik Heidler <dheidler@suse.de>
- Backport patches for Lua API fixes:
* lua_add_getCurrentWarpSpeed.patch
* lua_fix_multivar.patch
* lua_add_commandBypassSelfDestruct.patch
* lua_fix_commandCombatManeuver.patch
-------------------------------------------------------------------
Fri Jan 10 21:06:16 UTC 2025 - Dominik Heidler <dheidler@suse.de>
- Version 2024.12.08
* Remove 'f' suffix from numbers in lua (#2164)
* Some minor de updates
* fix minor typo
* more minor de updates
-------------------------------------------------------------------
Sun Sep 15 16:52:32 UTC 2024 - Dominik Heidler <dheidler@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package emptyepsilon
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: emptyepsilon
Version: 2024.08.09
Version: 2024.12.08
Release: 0
Summary: Open source spaceship bridge simulator
License: GPL-2.0-only
@@ -28,17 +28,23 @@ Source1: SeriousProton-%{version}.tar.gz
Source2: download.sh
Source3: basis_universal.zip
Source5: meshoptimizer.zip
Patch0: use_bundled_basis_universal.patch
Source6: use_bundled_basis_universal.patch
Patch1: use_bundled_meshoptimizer.patch
BuildRequires: SDL2-devel
Patch2: lua_add_getCurrentWarpSpeed.patch
Patch3: lua_fix_multivar.patch
Patch4: lua_add_commandBypassSelfDestruct.patch
Patch5: lua_fix_commandCombatManeuver.patch
BuildRequires: bsdtar
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glm-devel
BuildRequires: hicolor-icon-theme
BuildRequires: pkgconfig
BuildRequires: sfml2-devel
BuildRequires: xorg-x11
BuildRequires: pkgconfig(sdl2)
%if 0%{?sle_version:1}
# if sle_version is defined, this is not tumbleweed
BuildRequires: gcc10
@@ -52,11 +58,9 @@ Each officer fills a unique role: Captain, Helms, Weapons, Relay, Science, and E
%prep
# extract EE and SP inside the EE dir
%setup -q -a1 -n EmptyEpsilon-EE-%{version}
find -name .gitignore | xargs rm
pushd SeriousProton-EE-%{version}
%patch -P 0 -p1
popd
%patch -P 1 -p1
find -name .gitignore -delete
patch -d SeriousProton-EE-%{version} -p1 < %{S:6}
%autopatch -p1
# extract bundled dependencies
mkdir -p SeriousProton/externals/basis
@@ -78,6 +82,7 @@ popd
export CC=gcc-10
export CXX=g++-10
%endif
export CXXFLAGS="%{optflags} -DGLM_ENABLE_EXPERIMENTAL"
%cmake -DSERIOUS_PROTON_DIR="SeriousProton-EE-%{version}" \
-DCMAKE_BUILD_TYPE=Release \
-DCPACK_PACKAGE_VERSION_MAJOR="$(echo %{version} | cut -d. -f1)" \
@@ -91,15 +96,17 @@ export CXX=g++-10
%install
%cmake_install
%fdupes %{buildroot}/%{_datadir}
%files
%doc README.md
%{_bindir}/EmptyEpsilon
%{_docdir}/emptyepsilon/
%{_docdir}/emptyepsilon/script_reference.html
%{_datadir}/emptyepsilon/
%{_datadir}/applications/EmptyEpsilon.desktop
%{_datadir}/icons/hicolor/1024x1024/apps/EmptyEpsilon.png
%dir %{_datadir}/icons/hicolor/1024x1024/apps
%dir %{_datadir}/icons/hicolor/1024x1024
%{_datadir}/applications/io.github.daid.EmptyEpsilon.desktop
%{_datadir}/icons/hicolor/512x512/apps/io.github.daid.EmptyEpsilon.png
%{_datadir}/metainfo/io.github.daid.EmptyEpsilon.metainfo.xml
%dir %{_datadir}/icons/hicolor/512x512/apps
%dir %{_datadir}/icons/hicolor/512x512
%changelog

View File

@@ -0,0 +1,129 @@
From b4f0c114b91ca7e5aa3b3f4c9e691b087117ed19 Mon Sep 17 00:00:00 2001
From: Pithlit <Pithlit@mail.de>
Date: Wed, 14 Aug 2024 21:19:54 +0200
Subject: [PATCH] self descruct code bypass (designed for hardware
key-switches)
# Conflicts:
# src/spaceObjects/playerSpaceship.cpp
---
src/gui/hotkeyConfig.cpp | 2 ++
src/gui/hotkeyConfig.h | 1 +
src/screenComponents/selfDestructButton.cpp | 4 ++++
src/spaceObjects/playerSpaceship.cpp | 22 +++++++++++++++++++++
src/spaceObjects/playerSpaceship.h | 1 +
5 files changed, 30 insertions(+)
diff --git a/src/gui/hotkeyConfig.cpp b/src/gui/hotkeyConfig.cpp
index bf81006706..eca0c50409 100644
--- a/src/gui/hotkeyConfig.cpp
+++ b/src/gui/hotkeyConfig.cpp
@@ -267,6 +267,7 @@ Keys::Keys() :
engineering_repair_crew_right("ENGINEERING_REPAIR_CREW_RIGHT", "Right"),
engineering_self_destruct_start("ENGINEERING_SELF_DESTRUCT_START"),
engineering_self_destruct_confirm("ENGINEERING_SELF_DESTRUCT_CONFIRM"),
+ engineering_self_destruct_bypass("ENGINEERING_SELF_DESTRUCT_BYPASS"),
engineering_self_destruct_cancel("ENGINEERING_SELF_DESTRUCT_CANCEL"),
engineering_set_power_for_system{
{"ENGINEERING_SET_SYSTEM_POWER_REACTOR"},
@@ -474,6 +475,7 @@ void Keys::init()
//Various
spectator_show_callsigns.setLabel(tr("hotkey_menu", "Various"), tr("hotkey_various", "Show callsigns (spectator)"));
+ engineering_self_destruct_bypass.setLabel(tr("hotkey_menu", "Various"), tr("hotkey_various", "key-operated switch"));
//Debug
debug_show_fps.setLabel(tr("hotkey_menu", "Various"), tr("hotkey_debug", "Show FPS"));
diff --git a/src/gui/hotkeyConfig.h b/src/gui/hotkeyConfig.h
index af3cd917e9..a90838da1d 100644
--- a/src/gui/hotkeyConfig.h
+++ b/src/gui/hotkeyConfig.h
@@ -134,6 +134,7 @@ class Keys
sp::io::Keybinding engineering_repair_crew_right;
sp::io::Keybinding engineering_self_destruct_start;
sp::io::Keybinding engineering_self_destruct_confirm;
+ sp::io::Keybinding engineering_self_destruct_bypass;
sp::io::Keybinding engineering_self_destruct_cancel;
sp::io::Keybinding engineering_set_power_for_system[SYS_COUNT];
diff --git a/src/screenComponents/selfDestructButton.cpp b/src/screenComponents/selfDestructButton.cpp
index 21ed53e7b4..8bae10de51 100644
--- a/src/screenComponents/selfDestructButton.cpp
+++ b/src/screenComponents/selfDestructButton.cpp
@@ -49,6 +49,10 @@ void GuiSelfDestructButton::onUpdate()
confirm_button->hide();
my_spaceship->commandActivateSelfDestruct();
}
+ if (keys.engineering_self_destruct_bypass.getDown() && cancel_button->isVisible())
+ {
+ my_spaceship->commandBypassSelfDestruct();
+ }
if (keys.engineering_self_destruct_cancel.getDown() && cancel_button->isVisible())
{
activate_button->show();
diff --git a/src/spaceObjects/playerSpaceship.cpp b/src/spaceObjects/playerSpaceship.cpp
index c54717eaea..b86aaad60e 100644
--- a/src/spaceObjects/playerSpaceship.cpp
+++ b/src/spaceObjects/playerSpaceship.cpp
@@ -314,6 +314,10 @@ REGISTER_SCRIPT_SUBCLASS(PlayerSpaceship, SpaceShip)
/// Codes are 0-indexed. Index 0 corresponds to code A, 1 to B, etc.
/// Example: player:commandConfirmDestructCode(0,46223) -- commands submitting 46223 as self-destruct confirmation code A
REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, commandConfirmDestructCode);
+ /// Commands this PlayerSpaceship to bypass the self-destruct authorization code for the code request with the given index.
+ /// Codes are 0-indexed. Index 0 corresponds to code A, 1 to B, etc.
+ /// Example: player:commandConfirmDestructCode(0) -- commands bypassing self-destruct confirmation code A
+ REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, commandBypassSelfDestruct);
/// Commands this PlayerSpaceship to set its forward combat maneuver to the given value.
/// Valid values are any from -1.0 (full reverse) to 1.0 (full forward).
/// The maneuver continues until the ship's combat maneuver reserves are depleted.
@@ -500,6 +504,11 @@ static const int16_t CMD_SET_MAIN_SCREEN_OVERLAY = 0x0027;
static const int16_t CMD_HACKING_FINISHED = 0x0028;
static const int16_t CMD_CUSTOM_FUNCTION = 0x0029;
static const int16_t CMD_TURN_SPEED = 0x002A;
+static const int16_t CMD_SET_REPAIR_DOCKED = 0x002B;
+static const int16_t CMD_SET_SHARES_ENERGY = 0x002C;
+static const int16_t CMD_SET_RESTOCKS_PROBES = 0x002D;
+static const int16_t CMD_SET_RESTOCKS_MISSILES = 0x002E;
+static const int16_t CMD_CONFIRM_SELF_DESTRUCT_BYPASS = 0x002F;
string alertLevelToString(EAlertLevel level)
{
@@ -1776,6 +1785,12 @@ void PlayerSpaceship::onReceiveClientCommand(int32_t client_id, sp::io::DataBuff
self_destruct_code_confirmed[index] = true;
}
break;
+ case CMD_CONFIRM_SELF_DESTRUCT_BYPASS:
+ {
+ for (int8_t index = 0; index < max_self_destruct_codes; index++)
+ self_destruct_code_confirmed[index] = true;
+ }
+ break;
case CMD_COMBAT_MANEUVER_BOOST:
{
float request_amount;
@@ -2131,6 +2146,13 @@ void PlayerSpaceship::commandConfirmDestructCode(int8_t index, uint32_t code)
sendClientCommand(packet);
}
+void PlayerSpaceship::commandBypassSelfDestruct()
+{
+ sp::io::DataBuffer packet;
+ packet << CMD_CONFIRM_SELF_DESTRUCT_BYPASS;
+ sendClientCommand(packet);
+}
+
void PlayerSpaceship::commandCombatManeuverBoost(float amount)
{
combat_maneuver_boost_request = amount;
diff --git a/src/spaceObjects/playerSpaceship.h b/src/spaceObjects/playerSpaceship.h
index 7952a81e2d..77603c9d70 100644
--- a/src/spaceObjects/playerSpaceship.h
+++ b/src/spaceObjects/playerSpaceship.h
@@ -279,6 +279,7 @@ class PlayerSpaceship : public SpaceShip
void commandActivateSelfDestruct();
void commandCancelSelfDestruct();
void commandConfirmDestructCode(int8_t index, uint32_t code);
+ void commandBypassSelfDestruct();
void commandCombatManeuverBoost(float amount);
void commandCombatManeuverStrafe(float strafe);
void commandLaunchProbe(glm::vec2 target_position);

View File

@@ -0,0 +1,37 @@
From 3f17db4baa9ecc7d7e5a925afd1d3f9dba1b143e Mon Sep 17 00:00:00 2001
From: Pithlit <pithlit@mail.de>
Date: Sun, 30 Mar 2025 19:59:56 +0200
Subject: [PATCH] add api function getCurrentWarpSpeed
---
src/spaceObjects/spaceship.cpp | 4 ++++
src/spaceObjects/spaceship.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/spaceObjects/spaceship.cpp b/src/spaceObjects/spaceship.cpp
index 7a42b86ba2..7b5cb11fe9 100644
--- a/src/spaceObjects/spaceship.cpp
+++ b/src/spaceObjects/spaceship.cpp
@@ -292,6 +292,10 @@ REGISTER_SCRIPT_SUBCLASS_NO_CREATE(SpaceShip, ShipTemplateBasedObject)
/// Actual warp speed can be modified by "warp" system effectiveness.
/// Example: ship:getWarpSpeed();
REGISTER_SCRIPT_CLASS_FUNCTION(SpaceShip, getWarpSpeed);
+ /// Returns this SpaceShip's current warp speed.
+ /// Actual warp speed can be modified by "warp" system effectiveness.
+ /// Example: ship:getCurrentWarpSpeed();
+ REGISTER_SCRIPT_CLASS_FUNCTION(SpaceShip, getCurrentWarpSpeed);
/// Returns the arc, in degrees, for the BeamWeapon with the given index on this SpaceShip.
/// Example: ship:getBeamWeaponArc(0); -- returns beam weapon 0's arc
REGISTER_SCRIPT_CLASS_FUNCTION(SpaceShip, getBeamWeaponArc);
diff --git a/src/spaceObjects/spaceship.h b/src/spaceObjects/spaceship.h
index 8624673df1..77993a741f 100644
--- a/src/spaceObjects/spaceship.h
+++ b/src/spaceObjects/spaceship.h
@@ -417,6 +417,7 @@ class SpaceShip : public ShipTemplateBasedObject
return 0.0f;
}
}
+ float getCurrentWarpSpeed() { return current_warp; }
float getJumpDriveCharge() { return jump_drive_charge; }
void setJumpDriveCharge(float charge) { jump_drive_charge = charge; }
float getJumpDelay() { return jump_delay; }

View File

@@ -0,0 +1,66 @@
From c401c4ab03359ba27e91f285da71b0c190eb03fe Mon Sep 17 00:00:00 2001
From: Pithlit <Pithlit@mail.de>
Date: Mon, 31 Mar 2025 21:04:11 +0200
Subject: [PATCH] Fix commandCombatManeuver API
* register commandCombatManeuverStrafe and getCombatManeuverCharge functions
* amount is no longer directly set for the client. This caused issues
skipping the validity check of the given values.
---
src/spaceObjects/playerSpaceship.cpp | 10 ++++++++--
src/spaceObjects/spaceship.h | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/spaceObjects/playerSpaceship.cpp b/src/spaceObjects/playerSpaceship.cpp
index b86aaad60e..16653bc20f 100644
--- a/src/spaceObjects/playerSpaceship.cpp
+++ b/src/spaceObjects/playerSpaceship.cpp
@@ -318,12 +318,20 @@ REGISTER_SCRIPT_SUBCLASS(PlayerSpaceship, SpaceShip)
/// Codes are 0-indexed. Index 0 corresponds to code A, 1 to B, etc.
/// Example: player:commandConfirmDestructCode(0) -- commands bypassing self-destruct confirmation code A
REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, commandBypassSelfDestruct);
+ /// Returns how much charge there is in the combat maneuvering system (0.0-1.0)
+ REGISTER_SCRIPT_CLASS_FUNCTION(SpaceShip, getCombatManeuverCharge);
/// Commands this PlayerSpaceship to set its forward combat maneuver to the given value.
/// Valid values are any from -1.0 (full reverse) to 1.0 (full forward).
/// The maneuver continues until the ship's combat maneuver reserves are depleted.
/// Crew screens allow only forward combat maneuvers, and the combat maneuver controls do not reflect a boost set via this command.
/// Example: player:commandCombatManeuverBoost(0.5) -- commands boosting forward at half combat maneuver capacity
REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, commandCombatManeuverBoost);
+ /// Commands this PlayerSpaceship to set its sideways combat maneuver to the given value.
+ /// Valid values are any from -1.0 (full left) to 1.0 (full right).
+ /// The maneuver continues until the ship's combat maneuver reserves are depleted.
+ /// The combat maneuver controls on the crew screens do not reflect a boost set via this command.
+ /// Example: player:commandCombatManeuverStrafe(0.5) -- commands boosting right at half combat maneuver capacity
+ REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, commandCombatManeuverStrafe);
/// Commands this PlayerSpaceship to launch a ScanProbe to the given coordinates.
/// Example: player:commandLaunchProbe(1000,2000) -- commands launching a scan probe to 1000,2000
REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, commandLaunchProbe);
@@ -2155,7 +2163,6 @@ void PlayerSpaceship::commandBypassSelfDestruct()
void PlayerSpaceship::commandCombatManeuverBoost(float amount)
{
- combat_maneuver_boost_request = amount;
sp::io::DataBuffer packet;
packet << CMD_COMBAT_MANEUVER_BOOST << amount;
sendClientCommand(packet);
@@ -2163,7 +2170,6 @@ void PlayerSpaceship::commandCombatManeuverBoost(float amount)
void PlayerSpaceship::commandCombatManeuverStrafe(float amount)
{
- combat_maneuver_strafe_request = amount;
sp::io::DataBuffer packet;
packet << CMD_COMBAT_MANEUVER_STRAFE << amount;
sendClientCommand(packet);
diff --git a/src/spaceObjects/spaceship.h b/src/spaceObjects/spaceship.h
index 77993a741f..c2dfc538b9 100644
--- a/src/spaceObjects/spaceship.h
+++ b/src/spaceObjects/spaceship.h
@@ -392,6 +392,7 @@ class SpaceShip : public ShipTemplateBasedObject
impulse_acceleration = acceleration;
impulse_reverse_acceleration = reverse_acceleration.value_or(acceleration);
}
+ float getCombatManeuverCharge() { return combat_maneuver_charge; }
void setCombatManeuver(float boost, float strafe) { combat_maneuver_boost_speed = boost; combat_maneuver_strafe_speed = strafe; }
bool hasJumpDrive() { return has_jump_drive; }
void setJumpDrive(bool has_jump) { has_jump_drive = has_jump; }

37
lua_fix_multivar.patch Normal file
View File

@@ -0,0 +1,37 @@
From 6976a22b7bbc4b51d0c66ef05d4d650aadc2a71a Mon Sep 17 00:00:00 2001
From: Pithlit <pithlit@mail.de>
Date: Sun, 30 Mar 2025 19:46:43 +0200
Subject: [PATCH] lua get: handle functions that return multiple variables
.../get.lua?x,y=getPosition() behaves now as expected.
---
src/httpScriptAccess.cpp | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/httpScriptAccess.cpp b/src/httpScriptAccess.cpp
index 713a00c859..bc7479d1e1 100644
--- a/src/httpScriptAccess.cpp
+++ b/src/httpScriptAccess.cpp
@@ -77,7 +77,21 @@ EEHttpServer::EEHttpServer(int port, string static_file_path)
return "{\"ERROR\": \"Cannot set values through get.lua\", \"COMMAND\": \"" + i->second + "\"}";
}
// Build LUA-code
- luaCode += i->first + " = object:" + i->second + ", ";
+ int variables_count = i->first.count(",") + 1;
+ if (variables_count == 1)
+ {
+ luaCode += i->first + " = object:" + i->second + ", ";
+ }
+ else
+ {
+ int idx = 1;
+ for(auto& var: i->first.split(","))
+ {
+ luaCode += var + " = ({object:" + i->second + "})[" + std::to_string(idx) + "], ";
+ idx++;
+ }
+ }
+
} luaCode += "}";
// Run script