2025-08-23 06:40 CEST

spring: maintenance ddcb20c7 Diff ] Back to Repository ]
Author Committer Branch Timestamp Parent
Eshed Eshed maintenance 2019-03-20 23:34:49 maintenance a7bd843d
Changeset Add `GetUnitCurrentCommand` lua callout (0000437)

* Add `GetUnitCurrentCommand` lua callout

Spring.GetUnitCurrentCommand(unitID) -> [cmdID, cmdOpts (coded), cmdTag[, cmdParam1[, cmdParam2 ... ]]]

Options are coded as a single number and parameters are returned on the stack so that there are no table allocations. This is a form of optimisation because getting the current command is a common action but so far the only available option was GetUnitCommands(unitID, 1) which still allocated 3 tables.

* Fix

* changelog++

* Fix

# Conflicts:
# doc/changelog.txt
mod - doc/changelog.txt Diff ] File ]
mod - rts/Lua/LuaSyncedRead.cpp Diff ] File ]
mod - rts/Lua/LuaSyncedRead.h Diff ] File ]