Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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:1 by Bluestone, 6 years ago

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.

Last edited 6 years ago by Bluestone (previous) (diff)

comment:2 by Bluestone, 6 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 eronoobos, 6 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 Bluestone, 6 years ago

Resolution: duplicate
Status: newclosed

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").

Last edited 6 years ago by Bluestone (previous) (diff)
Note: See TracTickets for help on using tickets.