cityrpg / CityRPG

A sandbox-simulation styled mod for the game Blockland that simulates the life of a blocky city. Live, build, and thrive in a city made of blocks.
4 stars 3 forks source link

First weapon ("Gun") does not show up on the item sale list #23

Closed Dglider closed 4 years ago

Dglider commented 4 years ago

$CityRPG::guns is not initialized before the item list is started (~line 114 of prefs.cs)

Fix:

// Weapon Prices
$CityRPG::guns = 0;

$CityRPG::prices::weapon::name[$CityRPG::guns] = "gunItem";

And sellItem_List starts building from wrong index. (~line 248 of init.cs) Fix:

    for(%c = 0; %c < $CityRPG::guns; %c++)
    {
        %sellItem_List = %sellItem_List SPC strreplace($CityRPG::prices::weapon::name[%c].uiName, " ", "") SPC %c;
    }
    registerOutputEvent("fxDTSBrick", "sellItem", "list" @ %sellItem_List TAB "int 0 500 1");