2025-08-04 03:52 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002577Spring engineLuapublic2011-07-27 21:21
Reporterabma 
Assigned To 
PrioritynormalSeverityminorReproducibilitysometimes
StatusclosedResolutionno change required 
Product Version 
Target VersionFixed in Version 
Summary0002577: (master) lua errors in spring-headless
Descriptionwhen doing a game (using headless as spec) i get these lua-errors in infolog.txt from the headless client:

[f=0012527] Error: LuaRules::RunCallIn: error = 2, RecvFromSynced, [string "LuaRules/Gadgets/unit_los_only_sounds.lua"]:67: attempt to perform arithmetic on a string value
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0007094

Kloot (developer)

67 local volume = ((Spring.GetConfigString("snd_volunitreply") or 100) / 100)

There is a 'tonumber' missing here, so gadget bug (no reason why it would only show up for headless clients though).

~0007095

jK (developer)

Has nothing to do with tonumber (lua has autocasting).

The problem seems to be Spring.GetConfigString("snd_volunitreply") returns a empty string instead of nil, for a non-existing config tag, so it becomes:

  local volume = ("" or 100) / 100
which is the same as
  local volume = "" / 100

but it should be
  local volume = (nil or 100) / 100
which is the same as
  local volume = 100 / 100

~0007096

hoijui (reporter)

i think i got the same error with normal spring but NoSound=1

~0007101

abma (administrator)

hm... i had an
"snd_volunitreply="

line in my .springrc :-/

~0007102

jK (developer)

k, gadget/user error then
+Notes

-Issue History
Date Modified Username Field Change
2011-07-27 01:26 abma New Issue
2011-07-27 01:26 abma Graphics Card => unknown
2011-07-27 01:27 abma Description Updated
2011-07-27 17:28 Kloot Note Added: 0007094
2011-07-27 17:28 Kloot Status new => closed
2011-07-27 17:28 Kloot Resolution open => no change required
2011-07-27 19:27 jK Note Added: 0007095
2011-07-27 19:27 jK Status closed => feedback
2011-07-27 19:27 jK Resolution no change required => reopened
2011-07-27 19:28 jK Status feedback => new
2011-07-27 19:35 hoijui Note Added: 0007096
2011-07-27 20:57 abma Note Added: 0007101
2011-07-27 21:21 jK Note Added: 0007102
2011-07-27 21:21 jK Status new => closed
2011-07-27 21:21 jK Resolution reopened => no change required
+Issue History