2019-08-24 12:08 CEST

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0004932Spring engineGeneralpublic2016-01-20 20:15
Reportersilentwings 
Assigned Togajop 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version100.0+git 
Target VersionFixed in Version 
Summary0004932: unitDef:pairs() and weaponDef:pairs() gives warnings/errors about non-existent tags
Descriptioniterating with unitDef:pairs() or weaponDef:pairs() gives warnings/errors about tags that are not present in the unit/weapon def files.

Steps To ReproduceE.g. With bar-test, give a corcom, and use the code below (which I wrote to make example defs for the wiki - without copying the table first it can't be handled by table.save). It will give the following errors, all of which refer to tags that are not present in the unit/weapon def files.

[f=0011278] writing example unit def
[f=0011278] Warning: [ReturnFalse] builder - deprecated field!
[f=0011278] Warning: [ReturnFalse] canCrash - deprecated field!
[f=0011278] Warning: [ReturnFalse] canDGun - deprecated field!
[f=0011278] Error: [UnitDefIndex] ERROR_TYPE for key "canHover" in UnitDefs __index
[f=0011278] Error: [UnitDefIndex] ERROR_TYPE for key "drag" in UnitDefs __index
[f=0011278] Error: [UnitDefIndex] ERROR_TYPE for key "extractSquare" in UnitDefs __index
[f=0011278] Warning: [ReturnFalse] floater - deprecated field!
[f=0011278] Warning: [ReturnFalse] isCommander - deprecated field!
[f=0011278] Warning: [ReturnMinusOne] maxSlope - deprecated field!
[f=0011278] Warning: [ReturnNil] moveData - deprecated field!
[f=0011278] Warning: [ReturnEmptyString] type - deprecated field!
[f=0011278] writing example weapon def
[f=0011278] Error: [WeaponDefIndex] ERROR_TYPE for key "areaOfEffect" in WeaponDefs __index
[f=0011278] Error: [WeaponDefIndex] ERROR_TYPE for key "maxVelocity" in WeaponDefs __index
[f=0011278] Error: [WeaponDefIndex] ERROR_TYPE for key "onlyTargetCategories" in WeaponDefs __index
[f=0011278] Error: [WeaponDefIndex] ERROR_TYPE for key "restTime" in WeaponDefs __index
Additional Informationfunction widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)
    local unitDef = UnitDefs[unitDefID]
    local t = {}
    for k,v in unitDef:pairs() do
        t[k] = v
    end
    table.save(t, "lua_unitDef_" .. unitDef.name .. ".lua", "-- generated by table.save")
    
    if #unitDef.weapons==0 then return end
    local weaponDef = WeaponDefs[unitDef.weapons[1].weaponDef]
    local s = {}
    for k,v in weaponDef:pairs() do
        s[k] = v
    end
    table.save(s, "lua_weaponDef_" .. weaponDef.name .. ".lua", "-- generated by table.save")
end
TagsNo tags attached.
Checked infolog.txt for lua Errors
Attached Files

-Relationships
+Relationships

-Notes

~0015549

gajop (developer)

Fix cd9a4c6d4e66e97ad4745581279bf4b501c1fdfc committed to develop branch: fix 0004932, repo: spring changeset id: 6342
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2015-08-12 13:03 silentwings New Issue
2016-01-20 20:15 gajop Changeset attached => spring develop cd9a4c6d
2016-01-20 20:15 gajop Note Added: 0015549
2016-01-20 20:15 gajop Assigned To => gajop
2016-01-20 20:15 gajop Status new => resolved
2016-01-20 20:15 gajop Resolution open => fixed
+Issue History