#1125 closed defect (duplicate)
bgu_sInfo.lua crashes with unit outside of BAR
Reported by: | eronoobos | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | BAR | Version: | |
Keywords: | Cc: |
Description
On a map that defines units, bgu_sInfo.lua crashes @ line 753
[f=0028601] [barwidgets.lua] Error: Error in CommandsChanged(): [string "LuaUI/Widgets/bgu_sinfo.lua"]:753: attempt to index field '?' (a nil value)
line 753:
local description = UnitDefs[defID].tooltip or ''
I think all that it would take to prevent this is adding
if not unitDef then return end
after line 750
local unitDef = UnitDefs[defID]
Change History (4)
comment:2 by , 7 years ago
I'm not able to reproduce your crash. Testing with e.g. your map from https://springrts.com/phpbb/viewtopic.php?f=81&t=34723 and giving a wormtrigger gives me a warning (missing overlay) but not a crash.
comment:3 by , 7 years ago
Strange, I can't reproduce the crash either. It happened to another player when we were playing Cattle and Loveplay 8. For completeness I'll post the leadup to the crash from the infolog.
[f=0028201] Warning: Couldn't find texture "luaui/images/buildIcons/Overlays/underworm.dds"! [f=0028601] ERROR: invalid mouseOverUnitDefID [f=0028601] [barwidgets.lua] Error: Error in CommandsChanged(): [string "LuaUI/Widgets/bgu_sinfo.lua"]:753: attempt to index field '?' (a nil value) [f=0028601] [barwidgets.lua] Error: Removed widget: Selection info
comment:4 by , 7 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Aha - you have two bugs confused here, although I can see why you're confused.
What happens on frame 28201 is actually unrelated to what happens on 28601.
(And thanks, what happens on 28601 is #1087 is difficult to trigger - I didn't know what causes it - and I needed someone to trigger it and provide the debug info "ERROR: invalid mouseOverUnitDefID").
The functionality for external units is not present because BARs method of adding teamcolours onto build pics requires precomputed overlay images.
It's not yet decided what to do about this.