From 59f8469cc5eb289421088cfcb74cc440cc3ea336 Mon Sep 17 00:00:00 2001 From: darkrose Date: Thu, 6 Apr 2017 02:44:59 +1000 Subject: [PATCH] rewrite content_list to C --- src/CMakeLists.txt | 2 +- src/client.cpp | 2 +- src/content_clothesitem.cpp | 1228 +++++++++++++++-------------- src/content_clothesitem.h | 5 +- src/content_craft.cpp | 39 +- src/content_craftitem.cpp | 777 +++++++++--------- src/content_craftitem.h | 3 +- src/content_list.c | 126 +++ src/content_list.cpp | 49 -- src/content_list.h | 48 +- src/content_mapnode.cpp | 440 +++++------ src/content_mapnode_circuit.cpp | 56 +- src/content_mapnode_door.cpp | 56 +- src/content_mapnode_farm.cpp | 40 +- src/content_mapnode_furniture.cpp | 112 +-- src/content_mapnode_plants.cpp | 122 +-- src/content_mapnode_slab.cpp | 68 +- src/content_mapnode_special.cpp | 248 +++--- src/content_mapnode_stair.cpp | 92 +-- src/content_mapnode_util.cpp | 4 +- src/content_mob.cpp | 32 +- src/content_nodemeta.cpp | 655 ++++++++++----- src/content_sao.cpp | 6 +- src/content_toolitem.cpp | 170 ++-- src/crypto.c | 10 +- src/crypto.h | 6 +- src/crypto_base64.c | 4 +- src/game.cpp | 2 +- src/inventory.cpp | 58 +- src/inventory.h | 27 +- src/list.c | 1 + src/mapnode.h | 3 + src/mineral.cpp | 2 +- src/player.cpp | 29 +- src/player.h | 10 +- src/server.cpp | 28 +- 36 files changed, 2472 insertions(+), 2088 deletions(-) create mode 100644 src/content_list.c delete mode 100644 src/content_list.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d6afbb3..4e64695 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,7 +188,7 @@ set(common_SRCS content_mapnode_special.cpp content_mapnode_plants.cpp content_mapnode_util.cpp - content_list.cpp + content_list.c content_nodebox.cpp intl.cpp auth.cpp diff --git a/src/client.cpp b/src/client.cpp index bf08a49..564867f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1623,7 +1623,7 @@ void Client::useItem() std::string snd(""); content_t w = item->getContent(); if ((w&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) - snd = content_craftitem_features(w).sound_use; + snd = content_craftitem_features(w)->sound_use; if (snd != "") g_sound->playSound(snd,false); } diff --git a/src/content_clothesitem.cpp b/src/content_clothesitem.cpp index cef013b..280fdd2 100644 --- a/src/content_clothesitem.cpp +++ b/src/content_clothesitem.cpp @@ -22,31 +22,45 @@ #include "content_craft.h" #include "content_list.h" #include "content_mapnode.h" -#include #include "intl.h" -std::map g_content_clothesitem_features; +struct ClothesItemFeatures g_content_clothesitem_features[4096]; -ClothesItemFeatures & content_clothesitem_features(content_t i) +ClothesItemFeatures *content_clothesitem_features(content_t i) { + uint32_t j; if ((i&CONTENT_CLOTHESITEM_MASK) != CONTENT_CLOTHESITEM_MASK) - return g_content_clothesitem_features[CONTENT_IGNORE]; + return &g_content_clothesitem_features[0]; - std::map::iterator it = g_content_clothesitem_features.find(i); - if (it == g_content_clothesitem_features.end()) - return g_content_clothesitem_features[CONTENT_IGNORE]; - return it->second; + j = (i&~CONTENT_CLOTHESITEM_MASK); + if (j > 4095) + return &g_content_clothesitem_features[0]; + + return &g_content_clothesitem_features[j]; } void content_clothesitem_init() { - g_content_clothesitem_features.clear(); - content_t i; ClothesItemFeatures *f = NULL; + int k; + + for (k=0; k<4096; k++) { + g_content_clothesitem_features[k].content = CONTENT_IGNORE; + g_content_clothesitem_features[k].texture = std::string("unknown_item.png"); + g_content_clothesitem_features[k].overlay_texture = std::string(""); + g_content_clothesitem_features[k].description = std::wstring(L""); + g_content_clothesitem_features[k].type = CT_NONE; + g_content_clothesitem_features[k].armour = 0.; + g_content_clothesitem_features[k].warmth = 0.; + g_content_clothesitem_features[k].vacuum = 0.; + g_content_clothesitem_features[k].suffocate = 0.; + g_content_clothesitem_features[k].durability = 5; + g_content_clothesitem_features[k].effect = 1.; + } i = CONTENT_CLOTHESITEM_SPACESUIT_PANTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->texture = "clothes_pants_space.png"; f->overlay_texture = "clothes_player_pants_space.png"; @@ -64,11 +78,11 @@ void content_clothesitem_init() }; crafting::setRecipe(r,i,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_SPACESUIT_SHIRT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->texture = "clothes_shirt_space.png"; f->overlay_texture = "clothes_player_shirt_space.png"; @@ -86,11 +100,11 @@ void content_clothesitem_init() }; crafting::setRecipe(r,i,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_SPACESUIT_HELMET; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->texture = "clothes_helmet_space.png"; f->overlay_texture = "clothes_player_helmet_space.png"; @@ -102,11 +116,11 @@ void content_clothesitem_init() f->suffocate = 1.0; f->durability = 20; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_SPACESUIT_BOOTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->texture = "clothes_boots_space.png"; f->overlay_texture = "clothes_player_boots_space.png"; @@ -117,12 +131,12 @@ void content_clothesitem_init() f->vacuum = 1.0; f->durability = 20; crafting::setBootsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // cotton t-shirts i = CONTENT_CLOTHESITEM_COTTON_TSHIRT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_white.png"; @@ -132,11 +146,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TSHIRT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_blue.png"; @@ -146,11 +160,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TSHIRT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_green.png"; @@ -160,11 +174,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TSHIRT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_orange.png"; @@ -174,11 +188,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TSHIRT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_purple.png"; @@ -188,11 +202,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TSHIRT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_red.png"; @@ -202,11 +216,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TSHIRT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_yellow.png"; @@ -216,11 +230,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TSHIRT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_black.png"; @@ -230,12 +244,12 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setTShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // cotton shirts i = CONTENT_CLOTHESITEM_COTTON_SHIRT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_white.png"; @@ -245,11 +259,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHIRT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_blue.png"; @@ -259,11 +273,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHIRT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_green.png"; @@ -273,11 +287,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHIRT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_orange.png"; @@ -287,11 +301,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHIRT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_purple.png"; @@ -301,11 +315,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHIRT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_red.png"; @@ -315,11 +329,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHIRT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_yellow.png"; @@ -329,11 +343,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHIRT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_black.png"; @@ -343,12 +357,12 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // cotton shorts i = CONTENT_CLOTHESITEM_COTTON_SHORTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_white.png"; @@ -359,11 +373,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHORTS_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_blue.png"; @@ -374,11 +388,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHORTS_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_green.png"; @@ -389,11 +403,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHORTS_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_orange.png"; @@ -404,11 +418,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHORTS_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_purple.png"; @@ -419,11 +433,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHORTS_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_red.png"; @@ -434,11 +448,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHORTS_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_yellow.png"; @@ -449,11 +463,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_SHORTS_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_black.png"; @@ -464,12 +478,12 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 4; crafting::setShortsRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // cotton hats i = CONTENT_CLOTHESITEM_COTTON_HAT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_white.png"; @@ -479,11 +493,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_HAT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_blue.png"; @@ -493,11 +507,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_HAT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_green.png"; @@ -507,11 +521,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_HAT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_orange.png"; @@ -521,11 +535,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_HAT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_purple.png"; @@ -535,11 +549,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_HAT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_red.png"; @@ -549,11 +563,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_HAT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_yellow.png"; @@ -563,11 +577,11 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_HAT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_cotton_black.png"; @@ -577,12 +591,12 @@ void content_clothesitem_init() f->warmth = 0.05; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // cotton ties i = CONTENT_CLOTHESITEM_COTTON_TIE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_white.png"; @@ -592,11 +606,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_COTTON_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TIE_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_blue.png"; @@ -606,11 +620,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLUE,CONTENT_CRAFTITEM_COTTON_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TIE_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_green.png"; @@ -620,11 +634,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET_GREEN,CONTENT_CRAFTITEM_COTTON_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TIE_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_orange.png"; @@ -634,11 +648,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE,CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TIE_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_purple.png"; @@ -648,11 +662,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE,CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TIE_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_red.png"; @@ -662,11 +676,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET_RED,CONTENT_CRAFTITEM_COTTON_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TIE_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_yellow.png"; @@ -676,11 +690,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW,CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COTTON_TIE_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_black.png"; @@ -690,12 +704,12 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COTTON_SHEET_BLACK,CONTENT_CRAFTITEM_COTTON_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // canvas shirt i = CONTENT_CLOTHESITEM_CANVAS_SHIRT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_white.png"; @@ -706,11 +720,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHIRT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_blue.png"; @@ -721,11 +735,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHIRT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_green.png"; @@ -736,11 +750,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHIRT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_orange.png"; @@ -751,11 +765,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHIRT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_purple.png"; @@ -766,11 +780,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHIRT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_red.png"; @@ -781,11 +795,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHIRT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_yellow.png"; @@ -796,11 +810,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHIRT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_black.png"; @@ -811,12 +825,12 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // canvas pants / jeans i = CONTENT_CLOTHESITEM_CANVAS_PANTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_white.png"; @@ -827,11 +841,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_PANTS_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_blue.png"; @@ -842,11 +856,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_PANTS_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_green.png"; @@ -857,11 +871,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_PANTS_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_orange.png"; @@ -872,11 +886,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_PANTS_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_purple.png"; @@ -887,11 +901,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_PANTS_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_red.png"; @@ -902,11 +916,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_PANTS_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_yellow.png"; @@ -917,11 +931,11 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_PANTS_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_canvas_black.png"; @@ -932,12 +946,12 @@ void content_clothesitem_init() f->vacuum = 0.0; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // canvas shoes i = CONTENT_CLOTHESITEM_CANVAS_SHOES; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_white.png"; @@ -947,11 +961,11 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHOES_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_blue.png"; @@ -961,11 +975,11 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHOES_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_green.png"; @@ -975,11 +989,11 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHOES_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_orange.png"; @@ -989,11 +1003,11 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHOES_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_purple.png"; @@ -1003,11 +1017,11 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHOES_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_red.png"; @@ -1017,11 +1031,11 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHOES_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_yellow.png"; @@ -1031,11 +1045,11 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_SHOES_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_black.png"; @@ -1045,12 +1059,12 @@ void content_clothesitem_init() f->warmth = 0.45; f->vacuum = 0.0; crafting::setShoesRecipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // canvas belt i = CONTENT_CLOTHESITEM_CANVAS_BELT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_white.png"; @@ -1060,11 +1074,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_BELT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_blue.png"; @@ -1074,11 +1088,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_BELT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_green.png"; @@ -1088,11 +1102,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_BELT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_orange.png"; @@ -1102,11 +1116,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_BELT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_purple.png"; @@ -1116,11 +1130,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_BELT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_red.png"; @@ -1130,11 +1144,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_BELT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_yellow.png"; @@ -1144,11 +1158,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_CANVAS_BELT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_canvas_black.png"; @@ -1158,12 +1172,12 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setRow1Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // leather shirts i = CONTENT_CLOTHESITEM_LEATHER_JACKET; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_brown.png"; @@ -1174,11 +1188,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_white.png"; @@ -1189,11 +1203,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_blue.png"; @@ -1204,11 +1218,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_green.png"; @@ -1219,11 +1233,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_orange.png"; @@ -1234,11 +1248,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_purple.png"; @@ -1249,11 +1263,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_red.png"; @@ -1264,11 +1278,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_yellow.png"; @@ -1279,11 +1293,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_JACKET_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_leather_black.png"; @@ -1294,12 +1308,12 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setShirtRecipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // leather pants i = CONTENT_CLOTHESITEM_LEATHER_PANTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_brown.png"; @@ -1310,11 +1324,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_white.png"; @@ -1325,11 +1339,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_blue.png"; @@ -1340,11 +1354,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_green.png"; @@ -1355,11 +1369,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_orange.png"; @@ -1370,11 +1384,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_purple.png"; @@ -1385,11 +1399,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_red.png"; @@ -1400,11 +1414,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_yellow.png"; @@ -1415,11 +1429,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_PANTS_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_leather_black.png"; @@ -1430,12 +1444,12 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setPantsRecipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // leather hats i = CONTENT_CLOTHESITEM_LEATHER_HAT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_brown.png"; @@ -1445,11 +1459,11 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_white.png"; @@ -1459,11 +1473,11 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_blue.png"; @@ -1473,11 +1487,11 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_green.png"; @@ -1487,11 +1501,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_orange.png"; @@ -1501,11 +1515,11 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_purple.png"; @@ -1515,11 +1529,11 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_red.png"; @@ -1529,11 +1543,11 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_yellow.png"; @@ -1543,11 +1557,11 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HAT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_leather_black.png"; @@ -1557,12 +1571,12 @@ void content_clothesitem_init() f->warmth = 0.6; f->vacuum = 0.1; crafting::setHatRecipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // leather helmets i = CONTENT_CLOTHESITEM_LEATHER_HELMET; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_brown.png"; @@ -1573,11 +1587,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_white.png"; @@ -1588,11 +1602,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_blue.png"; @@ -1603,11 +1617,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_green.png"; @@ -1618,11 +1632,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_orange.png"; @@ -1633,11 +1647,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_purple.png"; @@ -1648,11 +1662,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_red.png"; @@ -1663,11 +1677,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_yellow.png"; @@ -1678,11 +1692,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_HELMET_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_leather_black.png"; @@ -1693,12 +1707,12 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setHelmetRecipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // leather shoes i = CONTENT_CLOTHESITEM_LEATHER_SHOES; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_brown.png"; @@ -1709,11 +1723,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_white.png"; @@ -1724,11 +1738,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_blue.png"; @@ -1739,11 +1753,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_green.png"; @@ -1754,11 +1768,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_orange.png"; @@ -1769,11 +1783,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_purple.png"; @@ -1784,11 +1798,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_red.png"; @@ -1799,11 +1813,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_yellow.png"; @@ -1814,11 +1828,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_SHOES_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_black.png"; @@ -1829,12 +1843,12 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setShoesRecipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // leather boots i = CONTENT_CLOTHESITEM_LEATHER_BOOTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_brown.png"; @@ -1845,11 +1859,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_white.png"; @@ -1860,11 +1874,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_blue.png"; @@ -1875,11 +1889,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_green.png"; @@ -1890,11 +1904,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_orange.png"; @@ -1905,11 +1919,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_purple.png"; @@ -1920,11 +1934,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_red.png"; @@ -1935,11 +1949,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_yellow.png"; @@ -1950,11 +1964,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BOOTS_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_leather_black.png"; @@ -1965,12 +1979,12 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 8; crafting::setBootsRecipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // leather belt i = CONTENT_CLOTHESITEM_LEATHER_BELT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_brown.png"; @@ -1981,11 +1995,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_white.png"; @@ -1996,11 +2010,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_blue.png"; @@ -2011,11 +2025,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_green.png"; @@ -2026,11 +2040,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_orange.png"; @@ -2041,11 +2055,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_purple.png"; @@ -2056,11 +2070,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_red.png"; @@ -2071,11 +2085,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_yellow.png"; @@ -2086,11 +2100,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_LEATHER_BELT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BELT; f->texture = "clothes_belt_leather_black.png"; @@ -2101,12 +2115,12 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 6; crafting::setRow1Recipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // fur jackets i = CONTENT_CLOTHESITEM_FUR_JACKET; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_brown.png"; @@ -2117,11 +2131,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_white.png"; @@ -2132,11 +2146,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_blue.png"; @@ -2147,11 +2161,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_green.png"; @@ -2162,11 +2176,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_orange.png"; @@ -2177,11 +2191,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_purple.png"; @@ -2192,11 +2206,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_red.png"; @@ -2207,11 +2221,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_yellow.png"; @@ -2222,11 +2236,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_JACKET_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_jacket_fur_black.png"; @@ -2237,12 +2251,12 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setShirtRecipe(CONTENT_CRAFTITEM_FUR_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // fur pants i = CONTENT_CLOTHESITEM_FUR_PANTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_brown.png"; @@ -2253,11 +2267,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_white.png"; @@ -2268,11 +2282,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_blue.png"; @@ -2283,11 +2297,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_green.png"; @@ -2298,11 +2312,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_orange.png"; @@ -2313,11 +2327,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_purple.png"; @@ -2328,11 +2342,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_red.png"; @@ -2343,11 +2357,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_yellow.png"; @@ -2358,11 +2372,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_PANTS_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_fur_black.png"; @@ -2373,12 +2387,12 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setPantsRecipe(CONTENT_CRAFTITEM_FUR_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // fur hats i = CONTENT_CLOTHESITEM_FUR_HAT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_brown.png"; @@ -2389,11 +2403,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_white.png"; @@ -2404,11 +2418,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_blue.png"; @@ -2419,11 +2433,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_green.png"; @@ -2434,11 +2448,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_orange.png"; @@ -2449,11 +2463,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_purple.png"; @@ -2464,11 +2478,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_red.png"; @@ -2479,11 +2493,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_yellow.png"; @@ -2494,11 +2508,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_HAT_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_hat_fur_black.png"; @@ -2509,12 +2523,12 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setHatRecipe(CONTENT_CRAFTITEM_FUR_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // fur shoes i = CONTENT_CLOTHESITEM_FUR_SHOES; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_brown.png"; @@ -2524,11 +2538,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_white.png"; @@ -2538,11 +2552,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_blue.png"; @@ -2552,11 +2566,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_green.png"; @@ -2566,11 +2580,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_orange.png"; @@ -2580,11 +2594,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_purple.png"; @@ -2594,11 +2608,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_red.png"; @@ -2608,11 +2622,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_yellow.png"; @@ -2622,11 +2636,11 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_SHOES_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_black.png"; @@ -2636,12 +2650,12 @@ void content_clothesitem_init() f->warmth = 1.0; f->vacuum = 0.05; crafting::setShoesRecipe(CONTENT_CRAFTITEM_FUR_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // fur boots i = CONTENT_CLOTHESITEM_FUR_BOOTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_brown.png"; @@ -2652,11 +2666,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_WHITE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_white.png"; @@ -2667,11 +2681,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_WHITE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_BLUE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_blue.png"; @@ -2682,11 +2696,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_BLUE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_GREEN; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_green.png"; @@ -2697,11 +2711,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_GREEN,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_ORANGE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_orange.png"; @@ -2712,11 +2726,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_ORANGE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_PURPLE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_purple.png"; @@ -2727,11 +2741,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_PURPLE,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_RED; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_red.png"; @@ -2742,11 +2756,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_RED,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_YELLOW; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_yellow.png"; @@ -2757,11 +2771,11 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_YELLOW,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_FUR_BOOTS_BLACK; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_fur_black.png"; @@ -2772,12 +2786,12 @@ void content_clothesitem_init() f->vacuum = 0.05; f->durability = 6; crafting::setBootsRecipe(CONTENT_CRAFTITEM_FUR_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // necklaces / medallions i = CONTENT_CLOTHESITEM_LEATHER_NECKLACE; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_DECORATIVE; f->texture = "clothes_necklace_leather.png"; @@ -2796,11 +2810,11 @@ void content_clothesitem_init() crafting::set1To1Recipe(CONTENT_CRAFTITEM_LEATHER_RED,i); crafting::set1To1Recipe(CONTENT_CRAFTITEM_LEATHER_YELLOW,i); crafting::set1To1Recipe(CONTENT_CRAFTITEM_LEATHER_BLACK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_GOLD_MEDALLION; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_MEDALLION; f->texture = "clothes_medallion_gold.png"; @@ -2812,11 +2826,11 @@ void content_clothesitem_init() f->effect = 1.8; f->durability = 8; crafting::set1over1Recipe(CONTENT_CLOTHESITEM_LEATHER_NECKLACE,CONTENT_CRAFTITEM_GOLD_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COPPER_MEDALLION; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_MEDALLION; f->texture = "clothes_medallion_copper.png"; @@ -2828,11 +2842,11 @@ void content_clothesitem_init() f->effect = 1.4; f->durability = 8; crafting::set1over1Recipe(CONTENT_CLOTHESITEM_LEATHER_NECKLACE,CONTENT_CRAFTITEM_COPPER_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_SILVER_MEDALLION; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_MEDALLION; f->texture = "clothes_medallion_silver.png"; @@ -2844,11 +2858,11 @@ void content_clothesitem_init() f->effect = 2.0; f->durability = 8; crafting::set1over1Recipe(CONTENT_CLOTHESITEM_LEATHER_NECKLACE,CONTENT_CRAFTITEM_SILVER_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_TIN_MEDALLION; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_MEDALLION; f->texture = "clothes_medallion_tin.png"; @@ -2860,11 +2874,11 @@ void content_clothesitem_init() f->effect = 1.2; f->durability = 8; crafting::set1over1Recipe(CONTENT_CLOTHESITEM_LEATHER_NECKLACE,CONTENT_CRAFTITEM_TIN_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_IRON_MEDALLION; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_MEDALLION; f->texture = "clothes_medallion_iron.png"; @@ -2876,11 +2890,11 @@ void content_clothesitem_init() f->effect = 1.6; f->durability = 8; crafting::set1over1Recipe(CONTENT_CLOTHESITEM_LEATHER_NECKLACE,CONTENT_CRAFTITEM_STEEL_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_QUARTZ_MEDALLION; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_MEDALLION; f->texture = "clothes_medallion_quartz.png"; @@ -2892,12 +2906,12 @@ void content_clothesitem_init() f->effect = 2.2; f->durability = 8; crafting::set1over1Recipe(CONTENT_CLOTHESITEM_LEATHER_NECKLACE,CONTENT_CRAFTITEM_QUARTZ,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // armour i = CONTENT_CLOTHESITEM_STEEL_HELMET; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_steel.png"; @@ -2908,11 +2922,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 10; crafting::setHatRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_STEEL_SHIRT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_shirt_steel.png"; @@ -2923,11 +2937,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 10; crafting::setShirtRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_STEEL_PANTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_steel.png"; @@ -2938,11 +2952,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 10; crafting::setPantsRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_STEEL_BOOTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_steel.png"; @@ -2953,11 +2967,11 @@ void content_clothesitem_init() f->vacuum = 0.1; f->durability = 10; crafting::setBootsRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COPPER_HELMET; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_HAT; f->texture = "clothes_helmet_copper.png"; @@ -2967,11 +2981,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setHatRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COPPER_SHIRT; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_JACKET; f->texture = "clothes_shirt_copper.png"; @@ -2981,11 +2995,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setShirtRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COPPER_PANTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_PANTS; f->texture = "clothes_pants_copper.png"; @@ -2995,11 +3009,11 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setPantsRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CLOTHESITEM_COPPER_BOOTS; - f = &g_content_clothesitem_features[i]; + f = &g_content_clothesitem_features[(i&~CONTENT_CLOTHESITEM_MASK)]; f->content = i; f->type = CT_BOOTS; f->texture = "clothes_boots_copper.png"; @@ -3009,6 +3023,6 @@ void content_clothesitem_init() f->warmth = 0.0; f->vacuum = 0.0; crafting::setBootsRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); } diff --git a/src/content_clothesitem.h b/src/content_clothesitem.h index 9aeec4c..e2dd103 100644 --- a/src/content_clothesitem.h +++ b/src/content_clothesitem.h @@ -24,7 +24,6 @@ #define CONTENT_CLOTHESITEM_HEADER #include "mapnode.h" -#include #define CONTENT_CLOTHESITEM_MASK 0x1000 @@ -78,10 +77,10 @@ struct ClothesItemFeatures { {} }; -extern std::map g_content_clothesitem_features; +extern struct ClothesItemFeatures g_content_clothesitem_features[4096]; // For getting the default properties, set id=CONTENT_IGNORE void content_clothesitem_init(); -ClothesItemFeatures & content_clothesitem_features(content_t i); +ClothesItemFeatures *content_clothesitem_features(content_t i); // fur was the first clothing added, they keep their original ids but are // actually defined below along with the other (newer) fur item. also diff --git a/src/content_craft.cpp b/src/content_craft.cpp index 25b4298..9797a54 100644 --- a/src/content_craft.cpp +++ b/src/content_craft.cpp @@ -38,6 +38,8 @@ #include #include +#include "list.h" + namespace crafting { std::vector shaped_recipes; @@ -882,7 +884,7 @@ FoundReverseRecipe getReverseRecipe(InventoryItem *iitem, int index) } //how to update an ingredient list given a range of new craft items -void addToIngredientList(std::vector results, uint32_t begin, std::vector& ingredient_list) +void addToIngredientList(std::vector results, uint32_t begin, std::vector& ingredient_list) { using namespace std; @@ -890,9 +892,9 @@ void addToIngredientList(std::vector results, uint32_t begin, s set ingredients (ingredient_list.begin(), ingredient_list.end()); //go through the result list - for (std::vector::iterator it = results.begin()+begin; it != results.end(); ++it) { + for (std::vector::iterator it = results.begin()+begin; it != results.end(); ++it) { - lists::ListData d = *it; + listdata_t d = *it; //make a temporary inventory item for the result InventoryItem *result = InventoryItem::create(d.content, 1, 0, d.data); @@ -926,6 +928,8 @@ void addToIngredientList(std::vector results, uint32_t begin, s std::vector& getCraftGuideIngredientList() { + contentlist_t *cl; + uint32_t list_size; using namespace std; //the ingredient list, and the number of items that were in the craftguide list at the last check @@ -933,16 +937,21 @@ std::vector& getCraftGuideIngredientList() static uint32_t last_craftguide_count = 0; //get the craftguide list - const vector& craft_list = lists::get("craftguide"); + cl = content_list_get("craftguide"); + if (!cl) + return ingredient_list; + + list_size = list_count(&cl->data); //check if more items need to be added - if (craft_list.size() > last_craftguide_count) { + if (list_size > last_craftguide_count) { //if so, add the new stuff - addToIngredientList(craft_list, last_craftguide_count, ingredient_list); + /* TODO: basically everything for reverse lookup */ + //addToIngredientList(craft_list, last_craftguide_count, ingredient_list); //and update the craftguide count - last_craftguide_count = craft_list.size(); + last_craftguide_count = list_size; } //return the list @@ -951,9 +960,15 @@ std::vector& getCraftGuideIngredientList() void giveCreative(Player *player) { - std::vector &creativeinv = lists::get("player-creative"); + contentlist_t *cl; + listdata_t *ld; + InventoryList *l; - InventoryList *l = player->inventory.getList("main"); + cl = content_list_get("player-creative"); + if (!cl) + return; + + l = player->inventory.getList("main"); // if the player doesn't have a creative chest, reset their inventory if (!l || l->findItem(CONTENT_CREATIVE_CHEST,NULL) != NULL) @@ -963,8 +978,10 @@ void giveCreative(Player *player) player->setClothesGiven(false); player->resetInventory(); - for(u8 i=0; iinventory.addItem("main", InventoryItem::create(creativeinv[i].content,creativeinv[i].count,0,creativeinv[i].data)); + ld = cl->data; + while (ld) { + player->inventory.addItem("main", InventoryItem::create(ld->content,ld->count,0,ld->data)); + ld = ld->next; } } diff --git a/src/content_craftitem.cpp b/src/content_craftitem.cpp index b745cf9..276c739 100644 --- a/src/content_craftitem.cpp +++ b/src/content_craftitem.cpp @@ -28,208 +28,213 @@ #include "content_craft.h" #include "content_mob.h" #include "content_list.h" -#include #include "intl.h" #include "player.h" -std::map g_content_craftitem_features; +struct CraftItemFeatures g_content_craftitem_features[4096]; -CraftItemFeatures & content_craftitem_features(content_t i) +CraftItemFeatures *content_craftitem_features(content_t i) { + uint32_t j; if ((i&CONTENT_CRAFTITEM_MASK) != CONTENT_CRAFTITEM_MASK) - return g_content_craftitem_features[CONTENT_IGNORE]; + return &g_content_craftitem_features[0]; - // convert deprecated items to new - if (i == (CONTENT_CRAFTITEM_MASK | 0x2D)) // rotten fruit - i = CONTENT_CRAFTITEM_MUSH; - if (i == (CONTENT_CRAFTITEM_MASK | 0x15)) // scorched stuff - i = CONTENT_CRAFTITEM_ASH; + j = (i&~CONTENT_CRAFTITEM_MASK); + if (j > 4095) + return &g_content_craftitem_features[0]; - std::map::iterator it = g_content_craftitem_features.find(i); - if (it == g_content_craftitem_features.end()) - return g_content_craftitem_features[CONTENT_IGNORE]; - return it->second; -} - -CraftItemFeatures & content_craftitem_features(std::string subname) -{ - // convert deprecated items to new - if (subname == "scorched_stuff") - return content_craftitem_features(CONTENT_CRAFTITEM_ASH); - if (subname == "rotten_fruit") - return content_craftitem_features(CONTENT_CRAFTITEM_MUSH); - - for (std::map::iterator i = g_content_craftitem_features.begin(); i!=g_content_craftitem_features.end(); i++) { - if (i->second.name == subname) - return i->second; - } - return g_content_craftitem_features[CONTENT_IGNORE]; + return &g_content_craftitem_features[j]; } void content_craftitem_init() { - g_content_craftitem_features.clear(); - content_t i; CraftItemFeatures *f = NULL; + int k; + + for (k=0; k<4096; k++) { + g_content_craftitem_features[k].content = CONTENT_IGNORE; + g_content_craftitem_features[k].texture = "unknown_item.png"; + g_content_craftitem_features[k].overlay_base = ""; + g_content_craftitem_features[k].name = ""; + g_content_craftitem_features[k].description = L""; + g_content_craftitem_features[k].cook_result = CONTENT_IGNORE; + g_content_craftitem_features[k].cook_type = COOK_ANY; + g_content_craftitem_features[k].fuel_time = 0.0; + g_content_craftitem_features[k].stackable = true; + g_content_craftitem_features[k].consumable = false; + g_content_craftitem_features[k].hunger_effect = 0; + g_content_craftitem_features[k].health_effect = 0; + g_content_craftitem_features[k].cold_effect = 0; + g_content_craftitem_features[k].energy_effect = 0; + g_content_craftitem_features[k].drop_count = -1; + g_content_craftitem_features[k].teleports = -2; + g_content_craftitem_features[k].param_type = CPT_NONE; + g_content_craftitem_features[k].drop_item = CONTENT_IGNORE; + g_content_craftitem_features[k].thrown_item = CONTENT_IGNORE; + g_content_craftitem_features[k].shot_item = CONTENT_IGNORE; + g_content_craftitem_features[k].onuse_replace_item = CONTENT_IGNORE; + g_content_craftitem_features[k].enchanted_item = CONTENT_IGNORE; + g_content_craftitem_features[k].sound_use = ""; + } i = CONTENT_CRAFTITEM_PAPER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_PAPER; f->texture = "paper.png"; f->name = "paper"; f->description = wgettext("Paper"); crafting::setRow3Recipe(CONTENT_PAPYRUS,CONTENT_CRAFTITEM_PAPER); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CHARCOAL; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CHARCOAL; f->texture = "lump_of_charcoal.png"; f->name = "lump_of_charcoal"; f->description = wgettext("Charcoal Lump"); f->fuel_time = 40; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COAL; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COAL; f->texture = "lump_of_coal.png"; f->name = "lump_of_coal"; f->description = wgettext("Coal Lump"); f->fuel_time = 40; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_IRON; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_IRON; f->texture = "lump_of_iron.png"; f->name = "lump_of_iron"; f->description = wgettext("Iron Lump"); f->cook_result = CONTENT_CRAFTITEM_STEEL_INGOT; f->cook_type = COOK_FURNACE; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_CLAY; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CLAY; f->texture = "lump_of_clay.png"; f->name = "lump_of_clay"; f->description = wgettext("Clay Lump"); f->cook_result = CONTENT_CRAFTITEM_CLAY_BRICK; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_TIN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_TIN; f->texture = "lump_of_tin.png"; f->name = "lump_of_tin"; f->description = wgettext("Tin Lump"); f->cook_result = CONTENT_CRAFTITEM_TIN_INGOT; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_COPPER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COPPER; f->texture = "lump_of_copper.png"; f->name = "lump_of_copper"; f->description = wgettext("Copper Lump"); f->cook_result = CONTENT_CRAFTITEM_COPPER_INGOT; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_SILVER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_SILVER; f->texture = "lump_of_silver.png"; f->name = "lump_of_silver"; f->description = wgettext("Silver Lump"); f->cook_result = CONTENT_CRAFTITEM_SILVER_INGOT; f->cook_type = COOK_FURNACE; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_GOLD; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_GOLD; f->texture = "lump_of_gold.png"; f->name = "lump_of_gold"; f->description = wgettext("Gold Lump"); f->cook_result = CONTENT_CRAFTITEM_GOLD_INGOT; f->cook_type = COOK_FURNACE; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_QUARTZ; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_QUARTZ; f->texture = "lump_of_quartz.png"; f->name = "lump_of_quartz"; f->description = wgettext("Quartz Crystal"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_TIN_INGOT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_TIN_INGOT; f->texture = "tin_ingot.png"; f->name = "tin_ingot"; f->description = wgettext("Tin Ingot"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COPPER_INGOT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COPPER_INGOT; f->texture = "copper_ingot.png"; f->name = "copper_ingot"; f->description = wgettext("Copper Ingot"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SILVER_INGOT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_SILVER_INGOT; f->texture = "silver_ingot.png"; f->name = "silver_ingot"; f->description = wgettext("Silver Ingot"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GOLD_INGOT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_GOLD_INGOT; f->texture = "gold_ingot.png"; f->name = "gold_ingot"; f->description = wgettext("Gold Ingot"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FLINT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FLINT; f->texture = "lump_of_flint.png"; f->name = "lump_of_flint"; f->description = wgettext("Flint"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_STEEL_INGOT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_STEEL_INGOT; f->texture = "steel_ingot.png"; f->name = "steel_ingot"; f->description = wgettext("Steel Ingot"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CLAY_BRICK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CLAY_BRICK; f->texture = "clay_brick.png"; f->name = "clay_brick"; f->description = wgettext("Brick"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_RAT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_RAT; f->texture = "rat.png"; f->name = "rat"; @@ -237,11 +242,11 @@ void content_craftitem_init() f->cook_result = CONTENT_CRAFTITEM_COOKED_RAT; f->drop_count = 1; f->drop_item = CONTENT_MOB_RAT; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_COOKED_RAT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COOKED_RAT; f->texture = "cooked_rat.png"; f->name = "cooked_rat"; @@ -251,21 +256,21 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 40; f->health_effect = 20; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_FIREFLY; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FIREFLY; f->texture = "firefly.png"; f->name = "firefly"; f->description = wgettext("Firefly"); f->drop_count = 1; f->drop_item = CONTENT_MOB_FIREFLY; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_APPLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_APPLE; f->texture = "apple.png^[forcesingle"; f->name = "apple"; @@ -274,10 +279,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 30; f->health_effect = 15; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_APPLE_IRON; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_APPLE_IRON; f->texture = "apple_iron.png"; f->name = "apple_iron"; @@ -294,121 +299,121 @@ void content_craftitem_init() }; crafting::setRecipe(recipe,CONTENT_CRAFTITEM_APPLE_IRON,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_BLUE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_BLUE; f->texture = "dye_blue.png"; f->name = "dye_blue"; f->description = wgettext("Blue Dye"); crafting::set1To2Recipe(CONTENT_FLOWER_TULIP,CONTENT_CRAFTITEM_DYE_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_GREEN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_GREEN; f->texture = "dye_green.png"; f->name = "dye_green"; f->description = wgettext("Green Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_ORANGE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_ORANGE; f->texture = "dye_orange.png"; f->name = "dye_orange"; f->description = wgettext("Orange Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_PURPLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_PURPLE; f->texture = "dye_purple.png"; f->name = "dye_purple"; f->description = wgettext("Purple Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_RED; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_RED; f->texture = "dye_red.png"; f->name = "dye_red"; f->description = wgettext("Red Dye"); crafting::set1To2Recipe(CONTENT_FLOWER_ROSE,CONTENT_CRAFTITEM_DYE_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_YELLOW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_YELLOW; f->texture = "dye_yellow.png"; f->name = "dye_yellow"; f->description = wgettext("Yellow Dye"); crafting::set1To2Recipe(CONTENT_CACTUS_BLOSSOM,CONTENT_CRAFTITEM_DYE_YELLOW); crafting::set1To2Recipe(CONTENT_FLOWER_DAFFODIL,CONTENT_CRAFTITEM_DYE_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_WHITE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_WHITE; f->texture = "dye_white.png"; f->name = "dye_white"; f->description = wgettext("White Dye"); crafting::set1To1Recipe(CONTENT_CRAFTITEM_APPLE_BLOSSOM,CONTENT_CRAFTITEM_DYE_WHITE); crafting::set2Any3Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_WHITE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DYE_BLACK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DYE_BLACK; f->texture = "dye_black.png"; f->name = "dye_black"; f->description = wgettext("Black Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_DYE_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_QUARTZ_DUST; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_QUARTZ_DUST; f->texture = "quartz_dust.png"; f->name = "quartz_dust"; f->description = wgettext("Quartz Dust"); crafting::set1To2Recipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_CRAFTITEM_QUARTZ_DUST); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SALTPETER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_SALTPETER; f->texture = "saltpeter.png"; f->name = "saltpeter"; f->description = wgettext("Saltpeter"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GUNPOWDER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_GUNPOWDER; f->texture = "gunpowder.png"; f->name = "gunpowder"; f->description = wgettext("Gun Powder"); crafting::set1Any3Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_SALTPETER,CONTENT_CRAFTITEM_GUNPOWDER); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SNOW_BALL; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_SNOW_BALL; f->texture = "snow_ball.png"; f->name = "snow_ball"; @@ -416,7 +421,7 @@ void content_craftitem_init() f->thrown_item = CONTENT_MOB_SNOWBALL; i = CONTENT_CRAFTITEM_STICK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_STICK; f->texture = "stick.png"; f->name = "Stick"; @@ -429,11 +434,11 @@ void content_craftitem_init() crafting::set1To2Recipe(CONTENT_APPLE_LEAVES,CONTENT_CRAFTITEM_STICK); crafting::set1To2Recipe(CONTENT_JUNGLELEAVES,CONTENT_CRAFTITEM_STICK); crafting::set1To2Recipe(CONTENT_CONIFER_LEAVES,CONTENT_CRAFTITEM_STICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_PINE_PLANK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_PINE_PLANK; f->texture = "pine_plank.png"; f->name = "pine_plank"; @@ -441,11 +446,11 @@ void content_craftitem_init() f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_WOOD_PINE,CONTENT_CRAFTITEM_PINE_PLANK); crafting::set1To2Recipe(CONTENT_YOUNG_CONIFER_TREE,CONTENT_CRAFTITEM_PINE_PLANK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_WOOD_PLANK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_WOOD_PLANK; f->texture = "wood_plank.png"; f->name = "wood_plank"; @@ -454,11 +459,11 @@ void content_craftitem_init() crafting::set1To4Recipe(CONTENT_WOOD,CONTENT_CRAFTITEM_WOOD_PLANK); crafting::set1To2Recipe(CONTENT_YOUNG_TREE,CONTENT_CRAFTITEM_WOOD_PLANK); crafting::set1To2Recipe(CONTENT_YOUNG_APPLE_TREE,CONTENT_CRAFTITEM_WOOD_PLANK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_JUNGLE_PLANK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_JUNGLE_PLANK; f->texture = "jungle_plank.png"; f->name = "jungle_plank"; @@ -466,11 +471,11 @@ void content_craftitem_init() f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_JUNGLE_PLANK); crafting::set1To2Recipe(CONTENT_YOUNG_JUNGLETREE,CONTENT_CRAFTITEM_JUNGLE_PLANK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_TNT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_TNT; f->texture = "tnt_stick.png"; f->name = "tnt_stick"; @@ -483,19 +488,19 @@ void content_craftitem_init() }; crafting::setRecipe(recipe,CONTENT_CRAFTITEM_TNT,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_ASH; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_ASH; f->texture = "lump_of_ash.png"; f->name = "lump_of_ash"; f->description = wgettext("Ash"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_APPLE_BLOSSOM; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_APPLE_BLOSSOM; f->texture = "apple_blossom.png"; f->name = "apple_blossom"; @@ -505,10 +510,10 @@ void content_craftitem_init() f->hunger_effect = 10; f->health_effect = 5; f->fuel_time = 30/16; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CACTUS_FRUIT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CACTUS_FRUIT; f->texture = "cactus_fruit.png^[forcesingle"; f->name = "cactus_fruit"; @@ -517,10 +522,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 30; f->health_effect = 15; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_MUSH; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_MUSH; f->texture = "mush.png"; f->name = "mush"; @@ -529,10 +534,10 @@ void content_craftitem_init() f->consumable = true; f->sound_use = "use-eat"; f->health_effect = -5; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_PUMPKINSLICE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_PUMPKINSLICE; f->texture = "pumpkin_slice.png"; f->name = "pumpkin_slice"; @@ -542,11 +547,11 @@ void content_craftitem_init() f->hunger_effect = 30; f->health_effect = 15; crafting::set1To2Recipe(CONTENT_FARM_PUMPKIN,CONTENT_CRAFTITEM_PUMPKINSLICE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_PUMPKIN_PIE_SLICE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_PUMPKIN_PIE_SLICE; f->texture = "pumpkin_pie_slice.png"; f->name = "pumpkin_pie_slice"; @@ -555,10 +560,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 60; f->health_effect = 30; - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); i = CONTENT_CRAFTITEM_APPLE_PIE_SLICE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_APPLE_PIE_SLICE; f->texture = "apple_pie_slice.png"; f->name = "apple_pie_slice"; @@ -567,10 +572,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 60; f->health_effect = 30; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_MELONSLICE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_MELONSLICE; f->texture = "melon_slice.png"; f->name = "melon_slice"; @@ -580,11 +585,11 @@ void content_craftitem_init() f->hunger_effect = 40; f->health_effect = 20; crafting::set1To2Recipe(CONTENT_FARM_MELON,CONTENT_CRAFTITEM_MELONSLICE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_WHEAT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_WHEAT; f->texture = "harvested_wheat.png"; f->name = "harvested_wheat"; @@ -593,10 +598,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 10; f->health_effect = 5; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FLOUR; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FLOUR; f->texture = "flour.png"; f->name = "flour"; @@ -606,11 +611,11 @@ void content_craftitem_init() f->hunger_effect = 10; f->health_effect = 5; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_FLOUR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_DOUGH; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_DOUGH; f->texture = "dough.png"; f->name = "dough"; @@ -621,12 +626,12 @@ void content_craftitem_init() f->hunger_effect = 20; f->health_effect = 10; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_DOUGH); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_BREAD; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_BREAD; f->texture = "bread.png"; f->name = "bread"; @@ -635,10 +640,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 50; f->health_effect = 20; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_POTATO; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_POTATO; f->texture = "harvested_potato.png"; f->name = "harvested_potato"; @@ -648,21 +653,21 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 30; f->health_effect = 15; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_STARCH; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_STARCH; f->texture = "potato_starch.png"; f->name = "potato_starch"; f->description = wgettext("Potato Starch"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_POTATO,CONTENT_CRAFTITEM_POTATO,CONTENT_CRAFTITEM_STARCH); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_ROASTPOTATO; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_ROASTPOTATO; f->texture = "roast_potato.png"; f->name = "roast_potato"; @@ -671,10 +676,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 60; f->health_effect = 30; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CARROT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CARROT; f->texture = "harvested_carrot.png"; f->name = "harvested_carrot"; @@ -683,10 +688,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 30; f->health_effect = 20; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CARROT_CAKE_RAW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CARROT_CAKE_RAW; f->texture = "carrot_cake_raw.png"; f->name = "carrot_cake_raw"; @@ -697,11 +702,11 @@ void content_craftitem_init() f->hunger_effect = 30; f->health_effect = 20; crafting::set1over1Recipe(CONTENT_CRAFTITEM_CARROT,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_CARROT_CAKE_RAW); - lists::add("craftguide",i); - lists::add("cooking",i); + content_list_add("craftguide",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_CARROT_CAKE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CARROT_CAKE; f->texture = "carrot_cake.png"; f->name = "carrot_cake"; @@ -710,10 +715,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 60; f->health_effect = 30; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_BEETROOT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_BEETROOT; f->texture = "harvested_beetroot.png"; f->name = "harvested_beetroot"; @@ -722,10 +727,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 30; f->health_effect = 15; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GRAPE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_GRAPE; f->texture = "harvested_grape.png"; f->name = "harvested_grape"; @@ -734,20 +739,20 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 30; f->health_effect = 20; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_STRING; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_STRING; f->texture = "string.png"; f->name = "string"; f->description = wgettext("String"); crafting::set1To4Recipe(CONTENT_COTTON,CONTENT_CRAFTITEM_STRING); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_MITHRILDUST; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_MITHRILDUST; f->texture = "mithril_dust.png"; f->name = "mese_dust"; @@ -755,21 +760,21 @@ void content_craftitem_init() f->drop_count = 1; f->drop_item = CONTENT_CIRCUIT_MITHRILWIRE; crafting::set1To2Recipe(CONTENT_CRAFTITEM_MITHRIL_RAW,CONTENT_CRAFTITEM_MITHRILDUST); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_RESIN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_RESIN; f->texture = "resin.png"; f->name = "lump_of_resin"; f->description = wgettext("Resin"); f->drop_count = 1; - lists::add("cooking",i); - lists::add("creative",i); + content_list_add("cooking",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_OERKKI_DUST; f->texture = "oerkki_dust.png"; f->name = "oerkki_dust"; @@ -784,11 +789,11 @@ void content_craftitem_init() }; crafting::setShapelessRecipe(recipe, i, 2); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FISH; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FISH; f->texture = "fish.png"; f->name = "fish"; @@ -800,11 +805,11 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 5; f->health_effect = -5; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_COOKED_FISH; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COOKED_FISH; f->texture = "cooked_fish.png"; f->name = "cooked_fish"; @@ -814,11 +819,11 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 40; f->health_effect = 30; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_MEAT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_MEAT; f->texture = "meat.png"; f->name = "meat"; @@ -828,11 +833,11 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 5; f->health_effect = -5; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_COOKED_MEAT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COOKED_MEAT; f->texture = "cooked_meat.png"; f->name = "cooked_meat"; @@ -842,11 +847,11 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 50; f->health_effect = 30; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET; f->texture = "cotton_sheet.png"; f->name = "cotton_sheet"; @@ -859,81 +864,81 @@ void content_craftitem_init() crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_COTTON_SHEET_RED,CONTENT_CRAFTITEM_COTTON_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW,CONTENT_CRAFTITEM_COTTON_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_COTTON_SHEET_BLACK,CONTENT_CRAFTITEM_COTTON_SHEET); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET_BLUE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET_BLUE; f->texture = "cotton_sheet_blue.png"; f->name = "cotton_sheet_blue"; f->description = wgettext("Blue Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_COTTON_SHEET_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET_GREEN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET_GREEN; f->texture = "cotton_sheet_green.png"; f->name = "cotton_sheet_green"; f->description = wgettext("Green Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_COTTON_SHEET_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE; f->texture = "cotton_sheet_orange.png"; f->name = "cotton_sheet_orange"; f->description = wgettext("Orange Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE; f->texture = "cotton_sheet_purple.png"; f->name = "cotton_sheet_purple"; f->description = wgettext("Purple Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET_RED; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET_RED; f->texture = "cotton_sheet_red.png"; f->name = "cotton_sheet_red"; f->description = wgettext("Red Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_COTTON_SHEET_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW; f->texture = "cotton_sheet_yellow.png"; f->name = "cotton_sheet_yellow"; f->description = wgettext("Yellow Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COTTON_SHEET_BLACK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_COTTON_SHEET_BLACK; f->texture = "cotton_sheet_black.png"; f->name = "cotton_sheet_black"; f->description = wgettext("Black Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_COTTON_SHEET_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET; f->texture = "canvas_sheet.png"; f->name = "canvas_sheet"; @@ -946,286 +951,286 @@ void content_craftitem_init() crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_CANVAS_SHEET_RED,CONTENT_CRAFTITEM_CANVAS_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW,CONTENT_CRAFTITEM_CANVAS_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK,CONTENT_CRAFTITEM_CANVAS_SHEET); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE; f->texture = "canvas_sheet_blue.png"; f->name = "canvas_sheet_blue"; f->description = wgettext("Blue Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN; f->texture = "canvas_sheet_green.png"; f->name = "canvas_sheet_green"; f->description = wgettext("Green Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE; f->texture = "canvas_sheet_orange.png"; f->name = "canvas_sheet_orange"; f->description = wgettext("Orange Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE; f->texture = "canvas_sheet_purple.png"; f->name = "canvas_sheet_purple"; f->description = wgettext("Purple Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET_RED; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_RED; f->texture = "canvas_sheet_red.png"; f->name = "canvas_sheet_red"; f->description = wgettext("Red Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_CANVAS_SHEET_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW; f->texture = "canvas_sheet_yellow.png"; f->name = "canvas_sheet_yellow"; f->description = wgettext("Yellow Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK; f->texture = "canvas_sheet_black.png"; f->name = "canvas_sheet_black"; f->description = wgettext("Black Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR; f->texture = "fur.png"; f->name = "fur"; f->description = wgettext("Fur"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_WHITE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_WHITE; f->texture = "fur_white.png"; f->name = "fur_white"; f->description = wgettext("White Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_FUR_WHITE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_FUR_WHITE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_BLUE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_BLUE; f->texture = "fur_blue.png"; f->name = "fur_blue"; f->description = wgettext("Blue Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_FUR_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_FUR_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_GREEN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_GREEN; f->texture = "fur_green.png"; f->name = "fur_green"; f->description = wgettext("Green Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_FUR_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_FUR_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_ORANGE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_ORANGE; f->texture = "fur_orange.png"; f->name = "fur_orange"; f->description = wgettext("Orange Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_FUR_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_FUR_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_PURPLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_PURPLE; f->texture = "fur_purple.png"; f->name = "fur_purple"; f->description = wgettext("Purple Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_FUR_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_FUR_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_RED; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_RED; f->texture = "fur_red.png"; f->name = "fur_red"; f->description = wgettext("Red Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_FUR_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_FUR_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_YELLOW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_YELLOW; f->texture = "fur_yellow.png"; f->name = "fur_yellow"; f->description = wgettext("Yellow Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_FUR_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_FUR_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_BLACK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FUR_BLACK; f->texture = "fur_black.png"; f->name = "fur_black"; f->description = wgettext("Black Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_FUR_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_FUR_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER; f->texture = "leather.png"; f->name = "leather"; f->description = wgettext("Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_ASH,CONTENT_CRAFTITEM_LEATHER); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_MUSH,CONTENT_CRAFTITEM_LEATHER); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_WHITE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_WHITE; f->texture = "leather_white.png"; f->name = "leather_white"; f->description = wgettext("White Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_LEATHER_WHITE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_LEATHER_WHITE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_BLUE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_BLUE; f->texture = "leather_blue.png"; f->name = "leather_blue"; f->description = wgettext("Blue Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_LEATHER_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_LEATHER_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_GREEN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_GREEN; f->texture = "leather_green.png"; f->name = "leather_green"; f->description = wgettext("Green Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_LEATHER_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_LEATHER_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_ORANGE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_ORANGE; f->texture = "leather_orange.png"; f->name = "leather_orange"; f->description = wgettext("Orange Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_LEATHER_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_LEATHER_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_PURPLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_PURPLE; f->texture = "leather_purple.png"; f->name = "leather_purple"; f->description = wgettext("Purple Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_LEATHER_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_LEATHER_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_RED; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_RED; f->texture = "leather_red.png"; f->name = "leather_red"; f->description = wgettext("Red Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_LEATHER_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_LEATHER_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_YELLOW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_YELLOW; f->texture = "leather_yellow.png"; f->name = "leather_yellow"; f->description = wgettext("Yellow Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_LEATHER_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_LEATHER_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_LEATHER_BLACK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_LEATHER_BLACK; f->texture = "leather_black.png"; f->name = "leather_black"; f->description = wgettext("Black Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_LEATHER_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_LEATHER_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_ARROW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_ARROW; f->texture = "arrow.png"; f->name = "arrow"; f->description = wgettext("Arrow"); f->shot_item = CONTENT_MOB_ARROW; crafting::set1over4Recipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_STICK,CONTENT_CRAFTITEM_ARROW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FERTILIZER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_FERTILIZER; f->texture = "fertilizer_item.png"; f->name = "fertilizer"; @@ -1233,11 +1238,11 @@ void content_craftitem_init() f->drop_count = 1; f->drop_item = CONTENT_FERTILIZER; crafting::set2Any2Recipe(CONTENT_CRAFTITEM_MUSH,CONTENT_CRAFTITEM_ASH,CONTENT_CRAFTITEM_FERTILIZER); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_WHITE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_white.png"; f->name = "oerkki_dust_white"; @@ -1245,11 +1250,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_WHITE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_OERKKI_DUST_WHITE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_BLUE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_blue.png"; f->name = "oerkki_dust_blue"; @@ -1257,11 +1262,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_BLUE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_OERKKI_DUST_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_GREEN; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_green.png"; f->name = "oerkki_dust_green"; @@ -1269,11 +1274,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_GREEN; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_OERKKI_DUST_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_ORANGE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_orange.png"; f->name = "oerkki_dust_orange"; @@ -1281,11 +1286,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_ORANGE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_OERKKI_DUST_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_PURPLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_purple.png"; f->name = "oerkki_dust_purple"; @@ -1293,11 +1298,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_PURPLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_OERKKI_DUST_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_RED; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_red.png"; f->name = "oerkki_dust_red"; @@ -1305,11 +1310,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_RED; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_OERKKI_DUST_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_YELLOW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_yellow.png"; f->name = "oerkki_dust_yellow"; @@ -1317,11 +1322,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_YELLOW; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_OERKKI_DUST_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_BLACK; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "oerkki_dust_black.png"; f->name = "oerkki_dust_black"; @@ -1329,11 +1334,11 @@ void content_craftitem_init() f->drop_count = 1; f->teleports = PLAYERFLAG_BLACK; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_OERKKI_DUST_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GLASS_BOTTLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "glass_bottle.png"; f->name = "glass_bottle"; @@ -1347,11 +1352,11 @@ void content_craftitem_init() }; crafting::setRecipe(r,CONTENT_CRAFTITEM_GLASS_BOTTLE,5); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GRAPE_JUICE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "drink_grape.png^glass_bottle.png"; f->name = "grape_juice"; @@ -1365,11 +1370,11 @@ void content_craftitem_init() f->energy_effect = 30; f->onuse_replace_item = CONTENT_CRAFTITEM_GLASS_BOTTLE; crafting::set1over1Recipe(CONTENT_CRAFTITEM_GRAPE,CONTENT_CRAFTITEM_GLASS_BOTTLE,CONTENT_CRAFTITEM_GRAPE_JUICE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_APPLE_JUICE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "drink_apple.png^glass_bottle.png"; f->name = "apple_juice"; @@ -1383,11 +1388,11 @@ void content_craftitem_init() f->energy_effect = 10; f->onuse_replace_item = CONTENT_CRAFTITEM_GLASS_BOTTLE; crafting::set1over1Recipe(CONTENT_CRAFTITEM_APPLE,CONTENT_CRAFTITEM_GLASS_BOTTLE,CONTENT_CRAFTITEM_APPLE_JUICE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_TEA_LEAVES; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "tea_leaves.png"; f->name = "tea_leaves"; @@ -1397,10 +1402,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 5; f->health_effect = 10; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_TEA; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "steel_bottle.png^tea_bag.png"; f->name = "tea_drink"; @@ -1415,11 +1420,11 @@ void content_craftitem_init() f->energy_effect = 10; f->onuse_replace_item = CONTENT_CRAFTITEM_STEEL_BOTTLE; crafting::set1over1Recipe(CONTENT_CRAFTITEM_TEA_LEAVES,CONTENT_CRAFTITEM_STEEL_BOTTLE_WATER,CONTENT_CRAFTITEM_TEA); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COFFEE_BEANS; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "coffee_beans.png"; f->name = "coffee_beans"; @@ -1430,10 +1435,10 @@ void content_craftitem_init() f->hunger_effect = 10; f->health_effect = 15; f->energy_effect = 30; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COFFEE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "steel_bottle.png^coffee_bean.png"; f->name = "coffee_drink"; @@ -1448,11 +1453,11 @@ void content_craftitem_init() f->energy_effect = 300; f->onuse_replace_item = CONTENT_CRAFTITEM_STEEL_BOTTLE; crafting::set1over1Recipe(CONTENT_CRAFTITEM_COFFEE_BEANS,CONTENT_CRAFTITEM_STEEL_BOTTLE_WATER,CONTENT_CRAFTITEM_COFFEE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_STEEL_BOTTLE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "steel_bottle.png"; f->name = "steel_bottle"; @@ -1466,11 +1471,11 @@ void content_craftitem_init() }; crafting::setRecipe(r,CONTENT_CRAFTITEM_STEEL_BOTTLE,5); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GLASS_BOTTLE_WATER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "drink_water.png^glass_bottle.png"; f->name = "water_drink"; @@ -1482,10 +1487,10 @@ void content_craftitem_init() f->hunger_effect = 5; f->health_effect = 5; f->onuse_replace_item = CONTENT_CRAFTITEM_GLASS_BOTTLE; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_STEEL_BOTTLE_WATER; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "steel_bottle.png^water_droplet.png"; f->name = "hotwater_drink"; @@ -1498,88 +1503,88 @@ void content_craftitem_init() f->health_effect = 8; f->cold_effect = 5; f->onuse_replace_item = CONTENT_CRAFTITEM_STEEL_BOTTLE; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_MITHRIL_RAW; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_MITHRIL_RAW; f->texture = "mithril_raw.png"; f->name = "mithril_raw"; f->description = wgettext("Raw Mithril"); f->cook_result = CONTENT_CRAFTITEM_MITHRIL_UNBOUND; f->cook_type = COOK_FURNACE; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CRAFTITEM_MITHRIL_UNBOUND; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_MITHRIL_UNBOUND; f->texture = "mithril_unbound.png"; f->name = "mithril_unbound"; f->enchanted_item = CONTENT_CRAFTITEM_MITHRIL; f->description = wgettext("Unbound Mithril"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_MITHRIL; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_MITHRIL; f->texture = "mithril_unbound.png"; f->name = "mithril_bound"; f->param_type = CPT_ENCHANTMENT; f->description = wgettext("Mithril"); f->overlay_base = "ingot_overlay"; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_RUBY; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "lump_of_ruby.png"; f->name = "lump_of_ruby"; f->description = wgettext("Ruby"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_TURQUOISE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "lump_of_turquoise.png"; f->name = "lump_of_turquiose"; f->description = wgettext("Turquiose"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_AMETHYST; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "lump_of_amethyst.png"; f->name = "lump_of_amethyst"; f->description = wgettext("Amethyst"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SAPPHIRE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "lump_of_sapphire.png"; f->name = "lump_of_sapphire"; f->description = wgettext("Sapphire"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SUNSTONE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "lump_of_sunstone.png"; f->name = "lump_of_sunstone"; f->description = wgettext("Sunstone"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SALT; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = i; f->texture = "salt.png"; f->name = "salt_dust"; f->description = wgettext("Salt"); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_SPACE; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_OERKKI_DUST_SPACE; f->texture = "oerkki_dust_space.png"; f->name = "oerkki_dust_space"; @@ -1594,11 +1599,11 @@ void content_craftitem_init() }; crafting::setRecipe(r,CONTENT_CRAFTITEM_OERKKI_DUST_SPACE,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_BLUEBERRY; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_BLUEBERRY; f->texture = "harvested_blueberry.png"; f->name = "blueberry"; @@ -1607,10 +1612,10 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 10; f->health_effect = 10; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_RASPBERRY; - f = &g_content_craftitem_features[i]; + f = &g_content_craftitem_features[(i&~CONTENT_CRAFTITEM_MASK)]; f->content = CONTENT_CRAFTITEM_RASPBERRY; f->texture = "harvested_raspberry.png"; f->name = "raspberry"; @@ -1619,5 +1624,5 @@ void content_craftitem_init() f->sound_use = "use-eat"; f->hunger_effect = 10; f->health_effect = 10; - lists::add("creative",i); + content_list_add("creative",i,1,0); } diff --git a/src/content_craftitem.h b/src/content_craftitem.h index 4f38152..9a6a565 100644 --- a/src/content_craftitem.h +++ b/src/content_craftitem.h @@ -105,8 +105,7 @@ struct CraftItemFeatures { }; void content_craftitem_init(); -CraftItemFeatures & content_craftitem_features(content_t i); -CraftItemFeatures & content_craftitem_features(std::string subname); +CraftItemFeatures *content_craftitem_features(content_t i); #define CONTENT_CRAFTITEM_PAPER (CONTENT_CRAFTITEM_MASK | 0x01) #define CONTENT_CRAFTITEM_CHARCOAL (CONTENT_CRAFTITEM_MASK | 0x03) diff --git a/src/content_list.c b/src/content_list.c new file mode 100644 index 0000000..ce9cc83 --- /dev/null +++ b/src/content_list.c @@ -0,0 +1,126 @@ +/************************************************************************ +* content_list.cpp +* voxelands - 3d voxel world sandbox game +* Copyright (C) Lisa Milne 2014-2017 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* See the GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see +************************************************************************/ + +#include +#include + +#include "content_list.h" +#include "list.h" +#include "crypto.h" + +static struct { + contentlist_t *lists; +} content_list_data = { + NULL +}; + +static int content_list_insert_cmp(void *e1, void *e2) +{ + contentlist_t *n1 = e1; + contentlist_t *n2 = e2; + + if (n2->h > n1->h) + return 0; + return 1; +} + +static listdata_t *content_list_find(contentlist_t *list, content_t c, uint16_t data) +{ + listdata_t *d; + + d = list->data; + while (d) { + if (d->content == c && d->data == data) + return d; + d = d->next; + } + + return NULL; +} + +static contentlist_t *content_list_create(const char* name) +{ + contentlist_t *l; + + l = malloc(sizeof(contentlist_t)); + + if (!l) + return NULL; + + l->name = strdup(name); + l->h = hash(name); + l->data = NULL; + l->count = 0; + + content_list_data.lists = list_insert_cmp(&content_list_data.lists,l,content_list_insert_cmp); + + return l; +} + +static void content_list_append(contentlist_t *list, content_t c, uint16_t count, uint16_t data) +{ + listdata_t *d; + + d = malloc(sizeof(listdata_t)); + if (!d) + return; + + d->content = c; + d->count = count; + d->data = data; + + list->data = list_push(&list->data,d); +} + +void content_list_add(const char* name, content_t c, uint16_t count, uint16_t data) +{ + contentlist_t *l; + listdata_t *d; + + l = content_list_get(name); + if (!l) + l = content_list_create(name); + if (!l) + return; + + d = content_list_find(l,c,data); + if (!d) { + content_list_append(l,c,count,data); + return; + } + + d->count = count; +} + +contentlist_t *content_list_get(const char* name) +{ + contentlist_t *l; + uint32_t h; + + l = content_list_data.lists; + h = hash(name); + + while (l) { + if (l->h == h && !strcmp(l->name,name)) + return l; + l = l->next; + } + + return NULL; +} diff --git a/src/content_list.cpp b/src/content_list.cpp deleted file mode 100644 index c75a0eb..0000000 --- a/src/content_list.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************ -* content_list.cpp -* voxelands - 3d voxel world sandbox game -* Copyright (C) Lisa Milne 2014 -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see -************************************************************************/ - -#include "mapnode.h" -#include "content_mapnode.h" -#include "content_list.h" -#include -#include -#include - -namespace lists { - -std::map< std::string , std::vector > c_lists; - -void add(std::string name, content_t c, uint16_t count, uint16_t data) -{ - for (std::vector::iterator i = c_lists[name].begin(); i != c_lists[name].end(); ++i) { - ListData d = *i; - if (d.content == c && d.data == data) { - i->count = count; - return; - } - } - - c_lists[name].push_back(ListData(c,count,data)); -} - -std::vector &get(std::string name) -{ - return c_lists[name]; -} - -}; diff --git a/src/content_list.h b/src/content_list.h index 04db60f..80144b9 100644 --- a/src/content_list.h +++ b/src/content_list.h @@ -1,29 +1,47 @@ #ifndef _CONTENT_LIST_H #define _CONTENT_LIST_H -#include +#ifdef __cplusplus +extern "C" { +#endif + +#include "array.h" + #include -namespace lists { +#ifndef _HAVE_CONTENT_TYPE +#define _HAVE_CONTENT_TYPE +typedef uint16_t content_t; +#endif -struct ListData { +#ifndef _HAVE_LISTDATA_TYPE +#define _HAVE_LISTDATA_TYPE +typedef struct listdata_s { + struct listdata_s *prev; + struct listdata_s *next; content_t content; uint16_t count; uint16_t data; +} listdata_t; +#endif - ListData() - {} +#ifndef _HAVE_CONTENTLIST_TYPE +#define _HAVE_CONTENTLIST_TYPE +typedef struct contentlist_s { + struct contentlist_s *prev; + struct contentlist_s *next; + char* name; + uint32_t h; + uint32_t count; + listdata_t *data; +} contentlist_t; +#endif - ListData(content_t c, uint16_t cc, uint16_t cd): - content(c), - count(cc), - data(cd) - {} -}; +void content_list_add(const char* name, content_t c, uint16_t count, uint16_t data); +contentlist_t *content_list_get(const char* name); -void add(std::string name, content_t c, uint16_t count=1, uint16_t data=0); -std::vector &get(std::string name); - -}; +#ifdef __cplusplus +} +#endif #endif diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 249a7e0..c7a9328 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -226,8 +226,8 @@ void content_mapnode_init(bool repeat) f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_ROUGHSTONE)+" 1"; f->type = CMT_STONE; f->hardness = 1.0; - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_LIMESTONE; f = &content_features(i); @@ -243,9 +243,9 @@ void content_mapnode_init(bool repeat) f->cook_type = COOK_FURNACE; f->type = CMT_STONE; f->hardness = 0.6; - lists::add("creative",i); - lists::add("cooking",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_SPACEROCK; f = &content_features(i); @@ -269,7 +269,7 @@ void content_mapnode_init(bool repeat) f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 1.0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_ROCK; f = &content_features(i); @@ -289,8 +289,8 @@ void content_mapnode_init(bool repeat) f->setInventoryTextureNodeBox(i,"stone.png", "stone.png", "stone.png"); crafting::set1To2Recipe(CONTENT_STONE_KNOB,CONTENT_ROCK); crafting::set1To2Recipe(CONTENT_ROUGHSTONE_KNOB,CONTENT_ROCK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ICE; f = &content_features(i); @@ -306,7 +306,7 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; f->warmth_per_second = 10; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_COAL; f = &content_features(i); @@ -322,8 +322,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_COAL,CONTENT_COAL); crafting::setUncraftHardBlockRecipe(CONTENT_COAL,CONTENT_CRAFTITEM_COAL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CHARCOAL; f = &content_features(i); @@ -339,8 +339,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CHARCOAL); crafting::setUncraftHardBlockRecipe(CONTENT_CHARCOAL,CONTENT_CRAFTITEM_CHARCOAL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONEBRICK; f = &content_features(i); @@ -353,8 +353,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_STONE,CONTENT_STONEBRICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONEBLOCK; f = &content_features(i); @@ -367,8 +367,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_STONE,CONTENT_STONEBLOCK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROUGHSTONEBRICK; f = &content_features(i); @@ -383,10 +383,10 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONEBRICK); - lists::add("craftguide",i); - lists::add("player-creative",i); - lists::add("cooking",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("player-creative",i,1,0); + content_list_add("cooking",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROUGHSTONEBLOCK; f = &content_features(i); @@ -401,9 +401,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONEBLOCK); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_GRASS; f = &content_features(i); @@ -421,7 +421,7 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; f->farm_ploughable = true; - lists::add("decrafting",i); + content_list_add("decrafting",i,1,0); i = CONTENT_GROWING_GRASS; f = &content_features(i); @@ -468,7 +468,7 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; f->farm_ploughable = true; - lists::add("decrafting",i); + content_list_add("decrafting",i,1,0); i = CONTENT_GROWING_GRASS_AUTUMN; f = &content_features(i); @@ -513,7 +513,7 @@ void content_mapnode_init(bool repeat) f->extra_dug_item_rarity = 5; f->type = CMT_DIRT; f->hardness = 1.0; - lists::add("decrafting",i); + content_list_add("decrafting",i,1,0); i = CONTENT_MUD; f = &content_features(i); @@ -532,7 +532,7 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; f->farm_ploughable = true; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_ASH; f = &content_features(i); @@ -545,9 +545,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 0.5; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_ASH,CONTENT_ASH); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_SAND; f = &content_features(i); @@ -565,9 +565,9 @@ void content_mapnode_init(bool repeat) f->cook_type = COOK_FURNACE; f->type = CMT_DIRT; f->hardness = 1.0; - lists::add("creative",i); - lists::add("cooking",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_DESERT_SAND; f = &content_features(i); @@ -585,9 +585,9 @@ void content_mapnode_init(bool repeat) f->cook_type = COOK_FURNACE; f->type = CMT_DIRT; f->hardness = 1.0; - lists::add("creative",i); - lists::add("cooking",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_GRAVEL; f = &content_features(i); @@ -603,8 +603,8 @@ void content_mapnode_init(bool repeat) f->extra_dug_item_min_level = 1; f->type = CMT_DIRT; f->hardness = 1.75; - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_SANDSTONE; f = &content_features(i); @@ -617,9 +617,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::setSoftBlockRecipe(CONTENT_SAND,CONTENT_SANDSTONE); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_SANDSTONE_BRICK; f = &content_features(i); @@ -632,9 +632,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_BRICK); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_SANDSTONE_BLOCK; f = &content_features(i); @@ -647,9 +647,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_BLOCK); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY; f = &content_features(i); @@ -666,10 +666,10 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_CLAY,CONTENT_CLAY); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("cooking",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY_BLUE; f = &content_features(i); @@ -684,9 +684,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CLAY,CONTENT_CLAY_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY_GREEN; f = &content_features(i); @@ -701,9 +701,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CLAY,CONTENT_CLAY_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY_ORANGE; f = &content_features(i); @@ -718,9 +718,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CLAY,CONTENT_CLAY_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY_PURPLE; f = &content_features(i); @@ -735,9 +735,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CLAY,CONTENT_CLAY_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY_RED; f = &content_features(i); @@ -752,9 +752,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CLAY,CONTENT_CLAY_RED); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY_YELLOW; f = &content_features(i); @@ -769,9 +769,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CLAY,CONTENT_CLAY_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CLAY_BLACK; f = &content_features(i); @@ -786,9 +786,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CLAY,CONTENT_CLAY_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_BRICK; f = &content_features(i); @@ -805,9 +805,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_CLAY_BRICK,CONTENT_BRICK); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_TERRACOTTA; f = &content_features(i); @@ -819,7 +819,7 @@ void content_mapnode_init(bool repeat) f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 1.0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_TERRACOTTA_BRICK; f = &content_features(i); @@ -832,8 +832,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA_BRICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TERRACOTTA_BLOCK; f = &content_features(i); @@ -846,8 +846,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA_BLOCK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TERRACOTTA_TILE; f = &content_features(i); @@ -865,8 +865,8 @@ void content_mapnode_init(bool repeat) content_nodebox_carpet(f); f->setInventoryTextureNodeBox(i,"terracotta_tile.png", "terracotta_tile.png", "terracotta_tile.png"); crafting::setTileRecipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA_TILE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS; f = &content_features(i); @@ -884,7 +884,7 @@ void content_mapnode_init(bool repeat) f->setInventoryTextureCube("glass.png", "glass.png", "glass.png"); f->type = CMT_GLASS; f->hardness = 0.15; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_BLUE; f = &content_features(i); @@ -903,8 +903,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_GLASS; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_GLASS,CONTENT_GLASS_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_GREEN; f = &content_features(i); @@ -923,8 +923,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_GLASS; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_GLASS,CONTENT_GLASS_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_ORANGE; f = &content_features(i); @@ -943,8 +943,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_GLASS; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_GLASS,CONTENT_GLASS_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PURPLE; f = &content_features(i); @@ -963,8 +963,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_GLASS; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_GLASS,CONTENT_GLASS_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_RED; f = &content_features(i); @@ -983,8 +983,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_GLASS; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_GLASS,CONTENT_GLASS_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_YELLOW; f = &content_features(i); @@ -1003,8 +1003,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_GLASS; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_GLASS,CONTENT_GLASS_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_BLACK; f = &content_features(i); @@ -1023,8 +1023,8 @@ void content_mapnode_init(bool repeat) f->type = CMT_GLASS; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_GLASS,CONTENT_GLASS_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE; f = &content_features(i); @@ -1056,8 +1056,8 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS,CONTENT_GLASS_PANE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE_BLUE; f = &content_features(i); @@ -1090,8 +1090,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS_BLUE,CONTENT_GLASS_PANE_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE_GREEN; f = &content_features(i); @@ -1124,8 +1124,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS_GREEN,CONTENT_GLASS_PANE_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE_ORANGE; f = &content_features(i); @@ -1158,8 +1158,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS_ORANGE,CONTENT_GLASS_PANE_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE_PURPLE; f = &content_features(i); @@ -1192,8 +1192,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS_PURPLE,CONTENT_GLASS_PANE_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE_RED; f = &content_features(i); @@ -1226,8 +1226,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS_RED,CONTENT_GLASS_PANE_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE_YELLOW; f = &content_features(i); @@ -1260,8 +1260,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS_YELLOW,CONTENT_GLASS_PANE_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PANE_BLACK; f = &content_features(i); @@ -1294,8 +1294,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setCol3Recipe(CONTENT_GLASS_BLACK,CONTENT_GLASS_PANE_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASSLIGHT; f = &content_features(i); @@ -1315,8 +1315,8 @@ void content_mapnode_init(bool repeat) f->hardness = 0.15; f->light_source = LIGHT_MAX-1; crafting::setSurroundRecipe(CONTENT_GLASS,CONTENT_CRAFTITEM_FIREFLY,CONTENT_GLASSLIGHT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD; f = &content_features(i); @@ -1341,8 +1341,8 @@ void content_mapnode_init(bool repeat) }; crafting::setRecipe(r,CONTENT_WOOD,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLEWOOD; f = &content_features(i); @@ -1366,8 +1366,8 @@ void content_mapnode_init(bool repeat) }; crafting::setRecipe(r,CONTENT_JUNGLEWOOD,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_PINE; f = &content_features(i); @@ -1391,8 +1391,8 @@ void content_mapnode_init(bool repeat) }; crafting::setRecipe(r,CONTENT_WOOD_PINE,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SPONGE; f = &content_features(i); @@ -1407,7 +1407,7 @@ void content_mapnode_init(bool repeat) f->type = CMT_DIRT; f->hardness = 1.0; f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_SPONGE_FULL; f = &content_features(i); @@ -1438,8 +1438,8 @@ void content_mapnode_init(bool repeat) f->hardness = 0.6; f->pressure_type = CST_CRUSHABLE; crafting::setSoftBlockRecipe(CONTENT_DEADGRASS,CONTENT_HAY); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_APPLE_PIE_RAW; f = &content_features(i); @@ -1465,9 +1465,9 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_APPLE,CONTENT_CRAFTITEM_DOUGH,CONTENT_APPLE_PIE_RAW); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_APPLE_PIE; f = &content_features(i); @@ -1492,8 +1492,8 @@ void content_mapnode_init(bool repeat) f->hardness = 0.1; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_APPLE_PIE_3; f = &content_features(i); @@ -1584,9 +1584,9 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::set1over1Recipe(CONTENT_CRAFTITEM_PUMPKINSLICE,CONTENT_CRAFTITEM_DOUGH,CONTENT_PUMPKIN_PIE_RAW); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_PUMPKIN_PIE; f = &content_features(i); @@ -1611,8 +1611,8 @@ void content_mapnode_init(bool repeat) f->hardness = 0.1; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_PUMPKIN_PIE_3; f = &content_features(i); @@ -1691,9 +1691,9 @@ void content_mapnode_init(bool repeat) f->hardness = 0.3; f->warmth_per_second = 10; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_SNOW_BALL,CONTENT_SNOW_BLOCK); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_SNOWMAN; f = &content_features(i); @@ -1753,9 +1753,9 @@ void content_mapnode_init(bool repeat) }; crafting::setRecipe(r,CONTENT_SNOWMAN,1); } - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_SNOW; f = &content_features(i); @@ -1777,8 +1777,8 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; f->warmth_per_second = 10; - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_COTTON; f = &content_features(i); @@ -1808,8 +1808,8 @@ void content_mapnode_init(bool repeat) crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_COTTON_YELLOW,CONTENT_COTTON); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_COTTON_BLACK,CONTENT_COTTON); crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_STRING,CONTENT_COTTON); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COTTON_BLUE; f = &content_features(i); @@ -1825,8 +1825,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; f->pressure_type = CST_DROPABLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_COTTON,CONTENT_COTTON_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COTTON_GREEN; f = &content_features(i); @@ -1842,8 +1842,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; f->pressure_type = CST_DROPABLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_COTTON,CONTENT_COTTON_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COTTON_ORANGE; f = &content_features(i); @@ -1859,8 +1859,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; f->pressure_type = CST_DROPABLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_COTTON,CONTENT_COTTON_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COTTON_PURPLE; f = &content_features(i); @@ -1876,8 +1876,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; f->pressure_type = CST_DROPABLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_COTTON,CONTENT_COTTON_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COTTON_RED; f = &content_features(i); @@ -1893,8 +1893,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; f->pressure_type = CST_DROPABLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_COTTON,CONTENT_COTTON_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COTTON_YELLOW; f = &content_features(i); @@ -1910,8 +1910,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; f->pressure_type = CST_DROPABLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_COTTON,CONTENT_COTTON_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COTTON_BLACK; f = &content_features(i); @@ -1927,8 +1927,8 @@ void content_mapnode_init(bool repeat) f->hardness = 1.0; f->pressure_type = CST_DROPABLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_COTTON,CONTENT_COTTON_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET; f = &content_features(i); @@ -1949,8 +1949,8 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_COTTON,CONTENT_CARPET); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET_BLUE; f = &content_features(i); @@ -1972,8 +1972,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_COTTON_BLUE,CONTENT_CARPET_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CARPET,CONTENT_CARPET_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET_GREEN; f = &content_features(i); @@ -1995,8 +1995,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_COTTON_GREEN,CONTENT_CARPET_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CARPET,CONTENT_CARPET_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET_ORANGE; f = &content_features(i); @@ -2018,8 +2018,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_COTTON_ORANGE,CONTENT_CARPET_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CARPET,CONTENT_CARPET_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET_PURPLE; f = &content_features(i); @@ -2041,8 +2041,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_COTTON_PURPLE,CONTENT_CARPET_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CARPET,CONTENT_CARPET_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET_RED; f = &content_features(i); @@ -2064,8 +2064,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_COTTON_RED,CONTENT_CARPET_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CARPET,CONTENT_CARPET_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET_YELLOW; f = &content_features(i); @@ -2087,8 +2087,8 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; crafting::setTileRecipe(CONTENT_COTTON_YELLOW,CONTENT_CARPET_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CARPET,CONTENT_CARPET_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CARPET_BLACK; f = &content_features(i); @@ -2110,8 +2110,8 @@ void content_mapnode_init(bool repeat) f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_COTTON_BLACK,CONTENT_CARPET_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CARPET,CONTENT_CARPET_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_AIR; f = &content_features(i); @@ -2281,9 +2281,9 @@ void content_mapnode_init(bool repeat) f->type = CMT_STONE; f->hardness = 0.9; crafting::setBlockRecipe(CONTENT_COBBLE,CONTENT_ROUGHSTONE); - lists::add("craftguide",i); - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_COBBLE; f = &content_features(i); @@ -2298,8 +2298,8 @@ void content_mapnode_init(bool repeat) f->hardness = 0.9; crafting::set5Recipe(CONTENT_ROUGHSTONE,CONTENT_COBBLE); crafting::setHardBlockRecipe(CONTENT_ROCK,CONTENT_COBBLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_MOSSYCOBBLE; f = &content_features(i); @@ -2312,7 +2312,7 @@ void content_mapnode_init(bool repeat) f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 0.8; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_STEEL; f = &content_features(i); @@ -2328,8 +2328,8 @@ void content_mapnode_init(bool repeat) f->destructive_mob_safe = true; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL); crafting::setUncraftHardBlockRecipe(CONTENT_STEEL,CONTENT_CRAFTITEM_STEEL_INGOT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_MITHRIL_BLOCK; f = &content_features(i); @@ -2346,8 +2346,8 @@ void content_mapnode_init(bool repeat) crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_MITHRIL_BLOCK); crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_MITHRIL_BLOCK); crafting::setUncraftHardBlockRecipe(CONTENT_MITHRIL_BLOCK,CONTENT_CRAFTITEM_MITHRIL_UNBOUND); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); content_nodedef_knob(CONTENT_STONE_KNOB, CONTENT_STONE, CMT_STONE, "stone.png", wgettext("Stone Knob")); content_nodedef_knob(CONTENT_ROUGHSTONE_KNOB, CONTENT_ROUGHSTONE, CMT_STONE, "roughstone.png", wgettext("Rough Stone Knob")); @@ -2370,8 +2370,8 @@ void content_mapnode_init(bool repeat) f->destructive_mob_safe = true; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_COPPER); crafting::setUncraftHardBlockRecipe(CONTENT_COPPER,CONTENT_CRAFTITEM_COPPER_INGOT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GOLD; f = &content_features(i); @@ -2387,8 +2387,8 @@ void content_mapnode_init(bool repeat) f->destructive_mob_safe = true; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_GOLD_INGOT,CONTENT_GOLD); crafting::setUncraftHardBlockRecipe(CONTENT_GOLD,CONTENT_CRAFTITEM_GOLD_INGOT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SILVER; f = &content_features(i); @@ -2404,8 +2404,8 @@ void content_mapnode_init(bool repeat) f->destructive_mob_safe = true; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_SILVER); crafting::setUncraftHardBlockRecipe(CONTENT_SILVER,CONTENT_CRAFTITEM_SILVER_INGOT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TIN; f = &content_features(i); @@ -2421,8 +2421,8 @@ void content_mapnode_init(bool repeat) f->destructive_mob_safe = true; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TIN); crafting::setUncraftHardBlockRecipe(CONTENT_TIN,CONTENT_CRAFTITEM_TIN_INGOT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_QUARTZ; f = &content_features(i); @@ -2438,8 +2438,8 @@ void content_mapnode_init(bool repeat) f->destructive_mob_safe = true; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_QUARTZ); crafting::setUncraftHardBlockRecipe(CONTENT_QUARTZ,CONTENT_CRAFTITEM_QUARTZ); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONE_TILE; f = &content_features(i); @@ -2458,8 +2458,8 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_STONE,CONTENT_STONE_TILE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_TILE; f = &content_features(i); @@ -2480,8 +2480,8 @@ void content_mapnode_init(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::setTileRecipe(CONTENT_WOOD,CONTENT_WOOD_TILE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONE_COLUMN_SQUARE; f = &content_features(i); @@ -2504,8 +2504,8 @@ void content_mapnode_init(bool repeat) f->onpunch_replace_respects_borderstone = true; crafting::setCol3Recipe(CONTENT_STONE, CONTENT_STONE_COLUMN_SQUARE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONE_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2561,8 +2561,8 @@ void content_mapnode_init(bool repeat) f->onpunch_replace_respects_borderstone = true; crafting::setCol3Recipe(CONTENT_LIMESTONE, CONTENT_LIMESTONE_COLUMN_SQUARE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LIMESTONE_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2618,8 +2618,8 @@ void content_mapnode_init(bool repeat) f->onpunch_replace_respects_borderstone = true; crafting::setCol3Recipe(CONTENT_MARBLE, CONTENT_MARBLE_COLUMN_SQUARE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_MARBLE_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2676,8 +2676,8 @@ void content_mapnode_init(bool repeat) f->onpunch_replace_respects_borderstone = true; crafting::setCol3Recipe(CONTENT_SANDSTONE, CONTENT_SANDSTONE_COLUMN_SQUARE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SANDSTONE_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2733,8 +2733,8 @@ void content_mapnode_init(bool repeat) f->onpunch_replace_respects_borderstone = true; crafting::setCol3Recipe(CONTENT_BRICK, CONTENT_BRICK_COLUMN_SQUARE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_BRICK_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2789,9 +2789,9 @@ void content_mapnode_init(bool repeat) f->fuel_time = 30/4; f->cook_result = std::string("CraftItem2 ")+itos(CONTENT_CRAFTITEM_ASH)+" 1"; crafting::setCol3Recipe(CONTENT_WOOD,CONTENT_WOOD_COLUMN_SQUARE); - lists::add("cooking",i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("cooking",i,1,0); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2850,9 +2850,9 @@ void content_mapnode_init(bool repeat) f->fuel_time = 30/4; f->cook_result = std::string("CraftItem2 ")+itos(CONTENT_CRAFTITEM_ASH)+" 1"; crafting::setCol3Recipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLEWOOD_COLUMN_SQUARE); - lists::add("cooking",i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("cooking",i,1,0); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLEWOOD_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2911,9 +2911,9 @@ void content_mapnode_init(bool repeat) f->fuel_time = 30/4; f->cook_result = std::string("CraftItem2 ")+itos(CONTENT_CRAFTITEM_ASH)+" 1"; crafting::setCol3Recipe(CONTENT_WOOD_PINE,CONTENT_WOOD_PINE_COLUMN_SQUARE); - lists::add("cooking",i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("cooking",i,1,0); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_PINE_COLUMN_SQUARE_BASE; f = &content_features(i); @@ -2968,8 +2968,8 @@ void content_mapnode_init(bool repeat) f->onpunch_replace_node = CONTENT_ROUGHSTONE_COLUMN_SQUARE_BASE; f->onpunch_replace_respects_borderstone = true; crafting::setCol3Recipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_COLUMN_SQUARE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROUGHSTONE_COLUMN_SQUARE_BASE; f = &content_features(i); diff --git a/src/content_mapnode_circuit.cpp b/src/content_mapnode_circuit.cpp index 2dd313b..434fcf0 100644 --- a/src/content_mapnode_circuit.cpp +++ b/src/content_mapnode_circuit.cpp @@ -51,8 +51,8 @@ void content_mapnode_circuit(bool repeat) content_nodebox_carpet(f); if (f->initial_metadata == NULL) f->initial_metadata = new CircuitNodeMetadata(); - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CIRCUIT_COPPERWIRE; f = &content_features(i); @@ -82,8 +82,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setShapelessRecipe(r,CONTENT_CIRCUIT_COPPERWIRE,10); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_REACTOR; f = &content_features(i); @@ -104,8 +104,8 @@ void content_mapnode_circuit(bool repeat) if (f->initial_metadata == NULL) f->initial_metadata = new SourceNodeMetadata(); crafting::setFilledRoundRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_CRAFTITEM_QUARTZ,CONTENT_CIRCUIT_REACTOR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_SOLARPANEL; f = &content_features(i); @@ -134,8 +134,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(r,CONTENT_CIRCUIT_SOLARPANEL,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_WATERWHEEL; f = &content_features(i); @@ -166,8 +166,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(r,CONTENT_CIRCUIT_WATERWHEEL,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_SWITCH; f = &content_features(i); @@ -201,8 +201,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_SWITCH,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_BUTTON; f = &content_features(i); @@ -232,8 +232,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_BUTTON,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_PRESSUREPLATE_STONE; f = &content_features(i); @@ -260,8 +260,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_PRESSUREPLATE_STONE,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_PRESSUREPLATE_WOOD; f = &content_features(i); @@ -288,8 +288,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_PRESSUREPLATE_WOOD,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_NOTGATE; f = &content_features(i); @@ -319,8 +319,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_NOTGATE,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_REPEATER; f = &content_features(i); @@ -350,8 +350,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_REPEATER,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_LAMP; f = &content_features(i); @@ -400,8 +400,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_LAMP_OFF,4); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // regular piston i = CONTENT_CIRCUIT_PISTON_OFF; @@ -435,8 +435,8 @@ void content_mapnode_circuit(bool repeat) }; crafting::setRecipe(recipe,CONTENT_CIRCUIT_PISTON_OFF,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_PISTON; f = &content_features(i); @@ -634,8 +634,8 @@ void content_mapnode_circuit(bool repeat) if (f->initial_metadata == NULL) f->initial_metadata = new PistonNodeMetadata(); crafting::set1over1Recipe(CONTENT_CRAFTITEM_RESIN,CONTENT_CIRCUIT_PISTON_OFF,CONTENT_CIRCUIT_STICKYPISTON_OFF); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CIRCUIT_STICKYPISTON; f = &content_features(i); diff --git a/src/content_mapnode_door.cpp b/src/content_mapnode_door.cpp index 02ec3bb..4248ab9 100644 --- a/src/content_mapnode_door.cpp +++ b/src/content_mapnode_door.cpp @@ -86,8 +86,8 @@ void content_mapnode_door(bool repeat) f->pressure_type = CST_SOLID; f->suffocation_per_second = 0; crafting::set1over1Recipe(CONTENT_WOOD_HATCH,CONTENT_WOOD_HATCH,CONTENT_WOOD_DOOR_LT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_DOOR_LB; f = &content_features(i); @@ -145,8 +145,8 @@ void content_mapnode_door(bool repeat) if (f->initial_metadata == NULL) f->initial_metadata = new DoorNodeMetadata(); crafting::set1over1Recipe(CONTENT_STEEL_HATCH,CONTENT_STEEL_HATCH,CONTENT_STEEL_DOOR_LT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_DOOR_LB; f = &content_features(i); @@ -206,8 +206,8 @@ void content_mapnode_door(bool repeat) f->pressure_type = CST_SOLID; f->suffocation_per_second = 0; crafting::set1over1Recipe(CONTENT_GLASS_PANE,CONTENT_GLASS_PANE,CONTENT_GLASS_DOOR_LT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_W_DOOR_LB; f = &content_features(i); @@ -266,8 +266,8 @@ void content_mapnode_door(bool repeat) f->suffocation_per_second = 0; crafting::set1over1Recipe(CONTENT_WOOD_W_HATCH,CONTENT_WOOD_HATCH,CONTENT_WOOD_W_DOOR_LT); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_WOOD_DOOR_LT,CONTENT_WOOD_W_DOOR_LT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_W_DOOR_LB; f = &content_features(i); @@ -328,8 +328,8 @@ void content_mapnode_door(bool repeat) f->initial_metadata = new DoorNodeMetadata(); crafting::set1over1Recipe(CONTENT_STEEL_W_HATCH,CONTENT_STEEL_HATCH,CONTENT_STEEL_W_DOOR_LT); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_STEEL_DOOR_LT,CONTENT_STEEL_W_DOOR_LT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // right doors i = CONTENT_WOOD_DOOR_RB; @@ -385,7 +385,7 @@ void content_mapnode_door(bool repeat) f->hardness = 0.75; f->pressure_type = CST_SOLID; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_DOOR_RB; f = &content_features(i); @@ -446,7 +446,7 @@ void content_mapnode_door(bool repeat) f->hardness = 0.15; f->pressure_type = CST_SOLID; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_DOOR_RB; f = &content_features(i); @@ -503,7 +503,7 @@ void content_mapnode_door(bool repeat) f->energy_type = CET_DEVICE; if (f->initial_metadata == NULL) f->initial_metadata = new DoorNodeMetadata(); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_W_DOOR_RB; f = &content_features(i); @@ -560,7 +560,7 @@ void content_mapnode_door(bool repeat) f->hardness = 0.75; f->pressure_type = CST_SOLID; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_W_DOOR_RB; f = &content_features(i); @@ -621,8 +621,8 @@ void content_mapnode_door(bool repeat) f->initial_metadata = new DoorNodeMetadata(); crafting::set1To1Recipe(CONTENT_STEEL_W_DOOR_LT,CONTENT_STEEL_W_DOOR_RT); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_STEEL_DOOR_RT,CONTENT_STEEL_W_DOOR_RT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // open doors i = CONTENT_WOOD_DOOR_LB_OPEN; @@ -1195,8 +1195,8 @@ void content_mapnode_door(bool repeat) f->suffocation_per_second = 0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_WOOD_HATCH); crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_WOOD_HATCH); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_HATCH; f = &content_features(i); @@ -1221,8 +1221,8 @@ void content_mapnode_door(bool repeat) if (f->initial_metadata == NULL) f->initial_metadata = new DoorNodeMetadata(); crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL_HATCH); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_W_HATCH; f = &content_features(i); @@ -1249,8 +1249,8 @@ void content_mapnode_door(bool repeat) f->pressure_type = CST_SOLID; f->suffocation_per_second = 0; crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_WOOD_HATCH,CONTENT_WOOD_W_HATCH); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_W_HATCH; f = &content_features(i); @@ -1278,8 +1278,8 @@ void content_mapnode_door(bool repeat) if (f->initial_metadata == NULL) f->initial_metadata = new DoorNodeMetadata(); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_STEEL_HATCH,CONTENT_STEEL_W_HATCH); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // gates i = CONTENT_WOOD_GATE; @@ -1311,8 +1311,8 @@ void content_mapnode_door(bool repeat) crafting::setGateRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_JUNGLEWOOD,CONTENT_WOOD_GATE); crafting::setGateRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_JUNGLEWOOD,CONTENT_WOOD_GATE); crafting::setGateRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_WOOD,CONTENT_WOOD_GATE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_GATE; f = &content_features(i); @@ -1341,8 +1341,8 @@ void content_mapnode_door(bool repeat) if (f->initial_metadata == NULL) f->initial_metadata = new DoorNodeMetadata(); crafting::setGateRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL,CONTENT_STEEL_GATE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // open hatches i = CONTENT_WOOD_HATCH_OPEN; diff --git a/src/content_mapnode_farm.cpp b/src/content_mapnode_farm.cpp index d228ef3..952eadd 100644 --- a/src/content_mapnode_farm.cpp +++ b/src/content_mapnode_farm.cpp @@ -43,7 +43,7 @@ void content_mapnode_farm(bool repeat) f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1"; f->type = CMT_DIRT; f->hardness = 1.0; - lists::add("decrafting",i); + content_list_add("decrafting",i,1,0); i = CONTENT_FERTILIZER; f = &content_features(i); @@ -81,8 +81,8 @@ void content_mapnode_farm(bool repeat) f->suffocation_per_second = 0; crafting::set5Recipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_TRELLIS); crafting::set5Recipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_TRELLIS); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_WHEAT; f = &content_features(i); @@ -102,7 +102,7 @@ void content_mapnode_farm(bool repeat) f->pressure_type = CST_CRUSHABLE; f->fuel_time = 2; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_MELON; f = &content_features(i); @@ -123,8 +123,8 @@ void content_mapnode_farm(bool repeat) f->fuel_time = 2; f->suffocation_per_second = 0; crafting::set1To1Recipe(CONTENT_CRAFTITEM_MELONSLICE,CONTENT_SEEDS_MELON); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_PUMPKIN; f = &content_features(i); @@ -145,8 +145,8 @@ void content_mapnode_farm(bool repeat) f->fuel_time = 2; f->suffocation_per_second = 0; crafting::set1To1Recipe(CONTENT_CRAFTITEM_PUMPKINSLICE,CONTENT_SEEDS_PUMPKIN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_POTATO; f = &content_features(i); @@ -167,8 +167,8 @@ void content_mapnode_farm(bool repeat) f->fuel_time = 2; f->suffocation_per_second = 0; crafting::set1To2Recipe(CONTENT_CRAFTITEM_POTATO,CONTENT_SEEDS_POTATO); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_CARROT; f = &content_features(i); @@ -189,8 +189,8 @@ void content_mapnode_farm(bool repeat) f->fuel_time = 2; f->suffocation_per_second = 0; crafting::set1To2Recipe(CONTENT_CRAFTITEM_CARROT,CONTENT_SEEDS_CARROT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_BEETROOT; f = &content_features(i); @@ -211,8 +211,8 @@ void content_mapnode_farm(bool repeat) f->fuel_time = 2; f->suffocation_per_second = 0; crafting::set1To2Recipe(CONTENT_CRAFTITEM_BEETROOT,CONTENT_SEEDS_BEETROOT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_GRAPE; f = &content_features(i); @@ -233,8 +233,8 @@ void content_mapnode_farm(bool repeat) f->fuel_time = 2; f->suffocation_per_second = 0; crafting::set1To2Recipe(CONTENT_CRAFTITEM_GRAPE,CONTENT_SEEDS_GRAPE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_COTTON; f = &content_features(i); @@ -254,7 +254,7 @@ void content_mapnode_farm(bool repeat) f->pressure_type = CST_CRUSHABLE; f->fuel_time = 2; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_FARM_WHEAT; f = &content_features(i); @@ -310,7 +310,7 @@ void content_mapnode_farm(bool repeat) f->plantgrowth_large_count = 1; f->type = CMT_PLANT; f->hardness = 0.4; - lists::add("creative", i); + content_list_add("creative",i,1,0); f->pressure_type = CST_CRUSHABLE; i = CONTENT_FARM_PUMPKIN_JACK; @@ -346,8 +346,8 @@ void content_mapnode_farm(bool repeat) f->hardness = 0.4; f->light_source = LIGHT_MAX-1; crafting::set1Any2Recipe(CONTENT_TORCH,CONTENT_FARM_PUMPKIN,CONTENT_FARM_PUMPKIN_JACK); - lists::add("creative", i); - lists::add("craftguide", i); + content_list_add("creative",i,1,0); + content_list_add("craftguide",i,1,0); f->pressure_type = CST_CRUSHABLE; i = CONTENT_FARM_POTATO; diff --git a/src/content_mapnode_furniture.cpp b/src/content_mapnode_furniture.cpp index b05e7cb..e59f300 100644 --- a/src/content_mapnode_furniture.cpp +++ b/src/content_mapnode_furniture.cpp @@ -64,8 +64,8 @@ void content_mapnode_furniture(bool repeat) crafting::setRecipe(r,CONTENT_BOOKSHELF,1); } f->pressure_type = CST_SOLID; - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_BOOKSHELF_JUNGLE; @@ -101,8 +101,8 @@ void content_mapnode_furniture(bool repeat) crafting::setRecipe(r,CONTENT_BOOKSHELF_JUNGLE,1); } f->pressure_type = CST_SOLID; - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_BOOKSHELF_PINE; @@ -138,8 +138,8 @@ void content_mapnode_furniture(bool repeat) crafting::setRecipe(r,CONTENT_BOOKSHELF_PINE,1); } f->pressure_type = CST_SOLID; - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE; @@ -262,8 +262,8 @@ void content_mapnode_furniture(bool repeat) crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR_RED,CONTENT_CRAFTITEM_STARCH,CONTENT_COUCH_CHAIR); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR_YELLOW,CONTENT_CRAFTITEM_STARCH,CONTENT_COUCH_CHAIR); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR_BLACK,CONTENT_CRAFTITEM_STARCH,CONTENT_COUCH_CHAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE_BLUE; @@ -380,8 +380,8 @@ void content_mapnode_furniture(bool repeat) f->setInventoryTextureNodeBox(i,"cotton_blue.png", "cotton_blue.png", "cotton_blue.png"); crafting::setVRecipe(CONTENT_COTTON_BLUE,CONTENT_COUCH_CHAIR_BLUE,2); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_COUCH_CHAIR_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE_GREEN; @@ -498,8 +498,8 @@ void content_mapnode_furniture(bool repeat) f->setInventoryTextureNodeBox(i,"cotton_green.png", "cotton_green.png", "cotton_green.png"); crafting::setVRecipe(CONTENT_COTTON_GREEN,CONTENT_COUCH_CHAIR_GREEN,2); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_COUCH_CHAIR_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE_ORANGE; @@ -616,8 +616,8 @@ void content_mapnode_furniture(bool repeat) f->setInventoryTextureNodeBox(i,"cotton_orange.png", "cotton_orange.png", "cotton_orange.png"); crafting::setVRecipe(CONTENT_COTTON_ORANGE,CONTENT_COUCH_CHAIR_ORANGE,2); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_COUCH_CHAIR_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE_PURPLE; @@ -734,8 +734,8 @@ void content_mapnode_furniture(bool repeat) f->setInventoryTextureNodeBox(i,"cotton_purple.png", "cotton_purple.png", "cotton_purple.png"); crafting::setVRecipe(CONTENT_COTTON_PURPLE,CONTENT_COUCH_CHAIR_PURPLE,2); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_COUCH_CHAIR_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE_RED; @@ -852,8 +852,8 @@ void content_mapnode_furniture(bool repeat) f->setInventoryTextureNodeBox(i,"cotton_red.png", "cotton_red.png", "cotton_red.png"); crafting::setVRecipe(CONTENT_COTTON_RED,CONTENT_COUCH_CHAIR_RED,2); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR,CONTENT_CRAFTITEM_DYE_RED,CONTENT_COUCH_CHAIR_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE_YELLOW; @@ -970,8 +970,8 @@ void content_mapnode_furniture(bool repeat) f->setInventoryTextureNodeBox(i,"cotton_yellow.png", "cotton_yellow.png", "cotton_yellow.png"); crafting::setVRecipe(CONTENT_COTTON_YELLOW,CONTENT_COUCH_CHAIR_YELLOW,2); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_COUCH_CHAIR_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_COUCH_CENTRE_BLACK; @@ -1088,8 +1088,8 @@ void content_mapnode_furniture(bool repeat) f->setInventoryTextureNodeBox(i,"cotton_black.png", "cotton_black.png", "cotton_black.png"); crafting::setVRecipe(CONTENT_COTTON_BLACK,CONTENT_COUCH_CHAIR_BLACK,2); crafting::set1Any2Recipe(CONTENT_COUCH_CHAIR,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_COUCH_CHAIR_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_CHAIR; @@ -1121,8 +1121,8 @@ void content_mapnode_furniture(bool repeat) }; crafting::setRecipe(r,CONTENT_CHAIR,2); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_CHAIR_CENTRE; @@ -1266,8 +1266,8 @@ void content_mapnode_furniture(bool repeat) }; crafting::setRecipe(r,CONTENT_TABLE,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_BED_HEAD; @@ -1296,8 +1296,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON,CONTENT_BED_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1355,8 +1355,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON_BLUE,CONTENT_BED_BLUE_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1414,8 +1414,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON_GREEN,CONTENT_BED_GREEN_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1473,8 +1473,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON_ORANGE,CONTENT_BED_ORANGE_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1532,8 +1532,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON_PURPLE,CONTENT_BED_PURPLE_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1591,8 +1591,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON_RED,CONTENT_BED_RED_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1650,8 +1650,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON_YELLOW,CONTENT_BED_YELLOW_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1709,8 +1709,8 @@ void content_mapnode_furniture(bool repeat) f->hardness = 0.25; f->pressure_type = CST_SOLID; crafting::setBedRecipe(CONTENT_COTTON_BLACK,CONTENT_BED_BLACK_HEAD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new BedNodeMetadata(); @@ -1770,8 +1770,8 @@ void content_mapnode_furniture(bool repeat) }; crafting::setRecipe(r,CONTENT_BED_CAMP_HEAD,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; if (f->initial_metadata == NULL) f->initial_metadata = new CampBedNodeMetadata(); @@ -1829,8 +1829,8 @@ void content_mapnode_furniture(bool repeat) crafting::setRecipe(r,CONTENT_PAINTING_WHITE,1); } crafting::set1Any2Recipe(CONTENT_PAINTING_CANVAS,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_PAINTING_WHITE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_PAINTING_RED; @@ -1863,8 +1863,8 @@ void content_mapnode_furniture(bool repeat) crafting::setRecipe(r,CONTENT_PAINTING_RED,1); } crafting::set1Any2Recipe(CONTENT_PAINTING_CANVAS,CONTENT_CRAFTITEM_DYE_RED,CONTENT_PAINTING_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_PAINTING_GREEN; @@ -1897,8 +1897,8 @@ void content_mapnode_furniture(bool repeat) crafting::setRecipe(r,CONTENT_PAINTING_GREEN,1); } crafting::set1Any2Recipe(CONTENT_PAINTING_CANVAS,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_PAINTING_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_PAINTING_BLUE; @@ -1931,8 +1931,8 @@ void content_mapnode_furniture(bool repeat) crafting::setRecipe(r,CONTENT_PAINTING_BLUE,1); } crafting::set1Any2Recipe(CONTENT_PAINTING_CANVAS,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_PAINTING_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_PAINTING_CANVAS; @@ -1968,8 +1968,8 @@ void content_mapnode_furniture(bool repeat) }; crafting::setRecipe(r,CONTENT_PAINTING_CANVAS,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_CLOCK; @@ -2003,7 +2003,7 @@ void content_mapnode_furniture(bool repeat) }; crafting::setRecipe(r,CONTENT_CLOCK,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; } diff --git a/src/content_mapnode_plants.cpp b/src/content_mapnode_plants.cpp index b9b54ad..2cd92cf 100644 --- a/src/content_mapnode_plants.cpp +++ b/src/content_mapnode_plants.cpp @@ -54,8 +54,8 @@ void content_mapnode_plants(bool repeat) f->ondig_special_drop = CONTENT_WOOD; f->ondig_special_drop_count = 6; f->ondig_special_tool = TT_AXE; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_APPLE_TREE; f = &content_features(i); @@ -75,8 +75,8 @@ void content_mapnode_plants(bool repeat) f->ondig_special_drop = CONTENT_WOOD; f->ondig_special_drop_count = 6; f->ondig_special_tool = TT_AXE; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_JUNGLETREE; f = &content_features(i); @@ -96,7 +96,7 @@ void content_mapnode_plants(bool repeat) f->ondig_special_drop = CONTENT_JUNGLEWOOD; f->ondig_special_drop_count = 6; f->ondig_special_tool = TT_AXE; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CONIFER_TREE; f = &content_features(i); @@ -116,8 +116,8 @@ void content_mapnode_plants(bool repeat) f->ondig_special_drop = CONTENT_WOOD_PINE; f->ondig_special_drop_count = 6; f->ondig_special_tool = TT_AXE; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_YOUNG_TREE; f = &content_features(i); @@ -137,7 +137,7 @@ void content_mapnode_plants(bool repeat) f->type = CMT_TREE; f->hardness = 1.0; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_YOUNG_JUNGLETREE; f = &content_features(i); @@ -157,7 +157,7 @@ void content_mapnode_plants(bool repeat) f->type = CMT_TREE; f->hardness = 1.0; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_YOUNG_APPLE_TREE; f = &content_features(i); @@ -177,7 +177,7 @@ void content_mapnode_plants(bool repeat) f->type = CMT_TREE; f->hardness = 1.0; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_YOUNG_CONIFER_TREE; f = &content_features(i); @@ -197,7 +197,7 @@ void content_mapnode_plants(bool repeat) f->type = CMT_TREE; f->hardness = 1.0; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLEGRASS; f = &content_features(i); @@ -218,7 +218,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.20; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLEFERN; f = &content_features(i); @@ -239,7 +239,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.20; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_LEAVES; f = &content_features(i); @@ -270,8 +270,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); - lists::add("cooking",i); + content_list_add("decrafting",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_LEAVES_AUTUMN; f = &content_features(i); @@ -302,8 +302,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); - lists::add("cooking",i); + content_list_add("decrafting",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_LEAVES_WINTER; f = &content_features(i); @@ -334,8 +334,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); - lists::add("cooking",i); + content_list_add("decrafting",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_LEAVES_SNOWY; f = &content_features(i); @@ -366,8 +366,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); - lists::add("cooking",i); + content_list_add("decrafting",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_APPLE_LEAVES; f = &content_features(i); @@ -399,8 +399,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); - lists::add("cooking",i); + content_list_add("decrafting",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_JUNGLELEAVES; f = &content_features(i); @@ -431,8 +431,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); - lists::add("cooking",i); + content_list_add("decrafting",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_CONIFER_LEAVES; f = &content_features(i); @@ -463,8 +463,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); - lists::add("cooking",i); + content_list_add("decrafting",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_TRIMMED_LEAVES; f = &content_features(i); @@ -488,8 +488,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_TRIMMED_LEAVES_AUTUMN; f = &content_features(i); @@ -513,8 +513,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_TRIMMED_LEAVES_WINTER; f = &content_features(i); @@ -538,8 +538,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_TRIMMED_APPLE_LEAVES; f = &content_features(i); @@ -563,8 +563,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_TRIMMED_JUNGLE_LEAVES; f = &content_features(i); @@ -588,8 +588,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_TRIMMED_CONIFER_LEAVES; f = &content_features(i); @@ -613,8 +613,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("cooking",i); + content_list_add("creative",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_APPLE_BLOSSOM; f = &content_features(i); @@ -639,7 +639,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("decrafting",i); + content_list_add("decrafting",i,1,0); i = CONTENT_TRIMMED_APPLE_BLOSSOM; f = &content_features(i); @@ -661,7 +661,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CACTUS_BLOSSOM; f = &content_features(i); @@ -681,7 +681,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.20; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CACTUS_FLOWER; f = &content_features(i); @@ -701,8 +701,8 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.20; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); - lists::add("decrafting",i); + content_list_add("creative",i,1,0); + content_list_add("decrafting",i,1,0); i = CONTENT_CACTUS_FRUIT; f = &content_features(i); @@ -722,7 +722,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.20; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CACTUS; f = &content_features(i); @@ -784,7 +784,7 @@ void content_mapnode_plants(bool repeat) f->type = CMT_WOOD; f->hardness = 0.75; f->pressure_type = CST_CRUSHABLE; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_PAPYRUS; f = &content_features(i); @@ -807,7 +807,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.25; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_SAPLING; f = &content_features(i); @@ -828,7 +828,7 @@ void content_mapnode_plants(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; f->fertilizer_affects = true; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_APPLE_SAPLING; f = &content_features(i); @@ -849,7 +849,7 @@ void content_mapnode_plants(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; f->fertilizer_affects = true; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLESAPLING; f = &content_features(i); @@ -870,7 +870,7 @@ void content_mapnode_plants(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; f->fertilizer_affects = true; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_CONIFER_SAPLING; f = &content_features(i); @@ -891,7 +891,7 @@ void content_mapnode_plants(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; f->fertilizer_affects = true; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_APPLE; f = &content_features(i); @@ -914,7 +914,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.0; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); // plants i = CONTENT_WILDGRASS_SHORT; @@ -1027,7 +1027,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.10; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_FLOWER_DAFFODIL; f = &content_features(i); @@ -1050,7 +1050,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.10; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_FLOWER_TULIP; f = &content_features(i); @@ -1073,7 +1073,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.10; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_SEEDS_TEA; f = &content_features(i); @@ -1092,7 +1092,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.4; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_TEA; f = &content_features(i); @@ -1115,7 +1115,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_BEANS_COFFEE; f = &content_features(i); @@ -1135,7 +1135,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.4; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_COFFEE; f = &content_features(i); @@ -1157,7 +1157,7 @@ void content_mapnode_plants(bool repeat) f->hardness = 0.15; f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_BUSH_BLUEBERRY; f = &content_features(i); @@ -1187,7 +1187,7 @@ void content_mapnode_plants(bool repeat) f->special_alternate_node = CONTENT_CRAFTITEM_BLUEBERRY; if(f->initial_metadata == NULL) f->initial_metadata = new BushNodeMetadata(); - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_BUSH_RASPBERRY; f = &content_features(i); @@ -1217,5 +1217,5 @@ void content_mapnode_plants(bool repeat) f->special_alternate_node = CONTENT_CRAFTITEM_RASPBERRY; if(f->initial_metadata == NULL) f->initial_metadata = new BushNodeMetadata(); - lists::add("creative",i); + content_list_add("creative",i,1,0); } diff --git a/src/content_mapnode_slab.cpp b/src/content_mapnode_slab.cpp index 6026a6c..5d9606d 100644 --- a/src/content_mapnode_slab.cpp +++ b/src/content_mapnode_slab.cpp @@ -47,8 +47,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 0.9; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COBBLE_SLAB; f = &content_features(i); @@ -65,8 +65,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 0.9; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_COBBLE,CONTENT_COBBLE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_MOSSYCOBBLE_SLAB; f = &content_features(i); @@ -83,8 +83,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 0.8; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONE_SLAB; f = &content_features(i); @@ -100,8 +100,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_STONE,CONTENT_STONE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_SLAB; f = &content_features(i); @@ -119,8 +119,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 0.75; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_WOOD,CONTENT_WOOD_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLE_SLAB; f = &content_features(i); @@ -138,8 +138,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_BRICK_SLAB; f = &content_features(i); @@ -159,8 +159,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_BRICK,CONTENT_BRICK_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SANDSTONE_SLAB; f = &content_features(i); @@ -176,8 +176,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_SLAB; f = &content_features(i); @@ -201,8 +201,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 0.15; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_BLUE_SLAB; f = &content_features(i); @@ -227,8 +227,8 @@ void content_mapnode_slab(bool repeat) f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_BLUE_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_GLASS_BLUE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_GREEN_SLAB; f = &content_features(i); @@ -253,8 +253,8 @@ void content_mapnode_slab(bool repeat) f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_GREEN_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_GLASS_GREEN_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_ORANGE_SLAB; f = &content_features(i); @@ -279,8 +279,8 @@ void content_mapnode_slab(bool repeat) f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_ORANGE_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_GLASS_ORANGE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_PURPLE_SLAB; f = &content_features(i); @@ -305,8 +305,8 @@ void content_mapnode_slab(bool repeat) f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_PURPLE_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_GLASS_PURPLE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_RED_SLAB; f = &content_features(i); @@ -331,8 +331,8 @@ void content_mapnode_slab(bool repeat) f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_RED_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_RED,CONTENT_GLASS_RED_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_YELLOW_SLAB; f = &content_features(i); @@ -357,8 +357,8 @@ void content_mapnode_slab(bool repeat) f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_YELLOW_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_GLASS_YELLOW_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_GLASS_BLACK_SLAB; f = &content_features(i); @@ -383,8 +383,8 @@ void content_mapnode_slab(bool repeat) f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_BLACK_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_GLASS_BLACK_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LIMESTONE_SLAB; f = &content_features(i); @@ -401,8 +401,8 @@ void content_mapnode_slab(bool repeat) f->hardness = 0.9; f->suffocation_per_second = 0; crafting::setRow3Recipe(CONTENT_LIMESTONE,CONTENT_LIMESTONE_SLAB); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // upside down slabs i = CONTENT_ROUGHSTONE_SLAB_UD; diff --git a/src/content_mapnode_special.cpp b/src/content_mapnode_special.cpp index a3c4895..c4d132b 100644 --- a/src/content_mapnode_special.cpp +++ b/src/content_mapnode_special.cpp @@ -57,8 +57,8 @@ void content_mapnode_special(bool repeat) content_nodebox_fence(f); f->setInventoryTextureNodeBox(i,"fence.png","fence_top.png","fence.png"); crafting::setWallRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_FENCE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_FENCE; f = &content_features(i); @@ -84,8 +84,8 @@ void content_mapnode_special(bool repeat) content_nodebox_fence(f); f->setInventoryTextureNodeBox(i,"fence_steel.png","fence_steel_top.png","fence_steel.png"); crafting::setWallRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL_FENCE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLE_FENCE; f = &content_features(i); @@ -112,8 +112,8 @@ void content_mapnode_special(bool repeat) content_nodebox_fence(f); f->setInventoryTextureNodeBox(i,"fence_jungle.png","fence_jungle_top.png","fence_jungle.png"); crafting::setWallRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_JUNGLE_FENCE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_PINE_FENCE; f = &content_features(i); @@ -140,8 +140,8 @@ void content_mapnode_special(bool repeat) content_nodebox_fence(f); f->setInventoryTextureNodeBox(i,"fence_pine.png","fence_pine_top.png","fence_pine.png"); crafting::setWallRecipe(CONTENT_CRAFTITEM_PINE_PLANK,CONTENT_PINE_FENCE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STEEL_BARS; f = &content_features(i); @@ -168,8 +168,8 @@ void content_mapnode_special(bool repeat) }; crafting::setRecipe(r,CONTENT_STEEL_BARS,6); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_RAIL; f = &content_features(i); @@ -200,8 +200,8 @@ void content_mapnode_special(bool repeat) f->setNodeBox(core::aabbox3d( -0.5*BS,-0.5*BS,-0.5*BS,0.5*BS,-0.375*BS,0.5*BS )); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_TERRACOTTA; f = &content_features(i); @@ -216,8 +216,8 @@ void content_mapnode_special(bool repeat) f->suffocation_per_second = 0; content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA,CONTENT_ROOFTILE_TERRACOTTA); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_WOOD; f = &content_features(i); @@ -233,8 +233,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_WOOD,CONTENT_WOOD,CONTENT_ROOFTILE_WOOD); crafting::set1over4Recipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLEWOOD,CONTENT_ROOFTILE_WOOD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_ASPHALT; f = &content_features(i); @@ -256,8 +256,8 @@ void content_mapnode_special(bool repeat) }; crafting::setRecipe(r,CONTENT_ROOFTILE_ASPHALT,4); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_STONE; f = &content_features(i); @@ -272,8 +272,8 @@ void content_mapnode_special(bool repeat) f->suffocation_per_second = 0; content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE,CONTENT_ROOFTILE_STONE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS; f = &content_features(i); @@ -294,8 +294,8 @@ void content_mapnode_special(bool repeat) f->suffocation_per_second = 0; content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS,CONTENT_GLASS,CONTENT_ROOFTILE_GLASS); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS_BLUE; f = &content_features(i); @@ -317,8 +317,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS_BLUE,CONTENT_GLASS_BLUE,CONTENT_ROOFTILE_GLASS_BLUE); crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_ROOFTILE_GLASS_BLUE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS_GREEN; f = &content_features(i); @@ -340,8 +340,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS_GREEN,CONTENT_GLASS_GREEN,CONTENT_ROOFTILE_GLASS_GREEN); crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_ROOFTILE_GLASS_GREEN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS_ORANGE; f = &content_features(i); @@ -363,8 +363,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS_ORANGE,CONTENT_GLASS_ORANGE,CONTENT_ROOFTILE_GLASS_ORANGE); crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_ROOFTILE_GLASS_ORANGE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS_PURPLE; f = &content_features(i); @@ -386,8 +386,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS_PURPLE,CONTENT_GLASS_PURPLE,CONTENT_ROOFTILE_GLASS_PURPLE); crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_ROOFTILE_GLASS_PURPLE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS_RED; f = &content_features(i); @@ -409,8 +409,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS_RED,CONTENT_GLASS_RED,CONTENT_ROOFTILE_GLASS_RED); crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_RED,CONTENT_ROOFTILE_GLASS_RED); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS_YELLOW; f = &content_features(i); @@ -432,8 +432,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS_YELLOW,CONTENT_GLASS_YELLOW,CONTENT_ROOFTILE_GLASS_YELLOW); crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_ROOFTILE_GLASS_YELLOW); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_GLASS_BLACK; f = &content_features(i); @@ -455,8 +455,8 @@ void content_mapnode_special(bool repeat) content_nodebox_roofcollide(f); crafting::set1over4Recipe(CONTENT_GLASS_BLACK,CONTENT_GLASS_BLACK,CONTENT_ROOFTILE_GLASS_BLACK); crafting::set1Any2Recipe(CONTENT_ROOFTILE_GLASS,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_ROOFTILE_GLASS_BLACK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROOFTILE_THATCH; f = &content_features(i); @@ -473,8 +473,8 @@ void content_mapnode_special(bool repeat) crafting::set1over4Recipe(CONTENT_DEADGRASS,CONTENT_DEADGRASS,CONTENT_ROOFTILE_THATCH); crafting::set1over4Recipe(CONTENT_WILDGRASS_SHORT,CONTENT_WILDGRASS_SHORT,CONTENT_ROOFTILE_THATCH); crafting::set1over4Recipe(CONTENT_JUNGLEGRASS,CONTENT_JUNGLEGRASS,CONTENT_ROOFTILE_THATCH); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LADDER_WALL; f = &content_features(i); @@ -532,8 +532,8 @@ void content_mapnode_special(bool repeat) r[8] = CONTENT_CRAFTITEM_JUNGLE_PLANK; crafting::setRecipe(r,CONTENT_LADDER_WALL,4); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LADDER_FLOOR; f = &content_features(i); @@ -626,9 +626,9 @@ void content_mapnode_special(bool repeat) }; crafting::setRecipe(r,CONTENT_BORDERSTONE,1); } - lists::add("craftguide",i); - lists::add("player-creative",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("player-creative",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_BOOK; f = &content_features(i); @@ -656,8 +656,8 @@ void content_mapnode_special(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::setCol1Recipe(CONTENT_CRAFTITEM_PAPER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); if (f->initial_metadata == NULL) f->initial_metadata = new ClosedBookNodeMetadata(); @@ -687,8 +687,8 @@ void content_mapnode_special(bool repeat) f->suffocation_per_second = 0; crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_COAL,i); crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_CHARCOAL,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); if (f->initial_metadata == NULL) f->initial_metadata = new ClosedBookNodeMetadata(); @@ -717,8 +717,8 @@ void content_mapnode_special(bool repeat) f->pressure_type = CST_CRUSHABLE; f->suffocation_per_second = 0; crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_GUNPOWDER,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); if (f->initial_metadata == NULL) f->initial_metadata = new ClosedBookNodeMetadata(); @@ -750,8 +750,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_STEEL_INGOT,i); if (f->initial_metadata == NULL) f->initial_metadata = new ClosedBookNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CRAFT_BOOK; f = &content_features(i); @@ -789,8 +789,8 @@ void content_mapnode_special(bool repeat) } if (f->initial_metadata == NULL) f->initial_metadata = new ClosedBookNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_RCRAFT_BOOK; f = &content_features(i); @@ -826,8 +826,8 @@ void content_mapnode_special(bool repeat) } if (f->initial_metadata == NULL) f->initial_metadata = new ClosedBookNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_BOOK_OPEN; f = &content_features(i); @@ -1055,9 +1055,9 @@ void content_mapnode_special(bool repeat) f->suffocation_per_second = 0; crafting::set1over4Recipe(CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); crafting::set1over4Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); - lists::add("craftguide",i); - lists::add("player-creative",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("player-creative",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SIGN_WALL; f = &content_features(i); @@ -1115,8 +1115,8 @@ void content_mapnode_special(bool repeat) crafting::setSignRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_SIGN); crafting::setSignRecipe(CONTENT_CRAFTITEM_PINE_PLANK,CONTENT_SIGN); crafting::setSignRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_SIGN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SIGN_UD; f = &content_features(i); @@ -1205,8 +1205,8 @@ void content_mapnode_special(bool repeat) f->setFaceText(5,FaceText(0.05,0.0675,0.95,0.55)); f->setInventoryTextureNodeBox(i,"sign.png", "sign_lock.png", "sign.png"); crafting::set1Any2Recipe(CONTENT_SIGN,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_SIGN); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LOCKABLE_SIGN_UD; f = &content_features(i); @@ -1258,8 +1258,8 @@ void content_mapnode_special(bool repeat) f->alternate_lockstate_node = CONTENT_LOCKABLE_CHEST; crafting::setRoundRecipe(CONTENT_WOOD,CONTENT_CHEST); crafting::setRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CHEST); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_CREATIVE_CHEST; f = &content_features(i); @@ -1279,8 +1279,8 @@ void content_mapnode_special(bool repeat) f->type = CMT_WOOD; f->hardness = 1.0; f->pressure_type = CST_SOLID; - lists::add("player-creative",i); - lists::add("creative",i); + content_list_add("player-creative",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LOCKABLE_CHEST; f = &content_features(i); @@ -1310,8 +1310,8 @@ void content_mapnode_special(bool repeat) crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SAFE; f = &content_features(i); @@ -1332,8 +1332,8 @@ void content_mapnode_special(bool repeat) f->pressure_type = CST_SOLID; f->destructive_mob_safe = true; crafting::setFilledRoundRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_SAFE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FURNACE; f = &content_features(i); @@ -1358,8 +1358,8 @@ void content_mapnode_special(bool repeat) f->pressure_type = CST_SOLID; f->alternate_lockstate_node = CONTENT_LOCKABLE_FURNACE; crafting::setRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_FURNACE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FURNACE_ACTIVE; f = &content_features(i); @@ -1403,8 +1403,8 @@ void content_mapnode_special(bool repeat) f->alternate_lockstate_node = CONTENT_FURNACE; crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); crafting::set1Any2Recipe(CONTENT_FURNACE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LOCKABLE_FURNACE_ACTIVE; f = &content_features(i); @@ -1446,8 +1446,8 @@ void content_mapnode_special(bool repeat) f->hardness = 0.4; f->pressure_type = CST_SOLID; crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_INCINERATOR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_INCINERATOR_ACTIVE; f = &content_features(i); @@ -1506,8 +1506,8 @@ void content_mapnode_special(bool repeat) }; crafting::setRecipe(r,CONTENT_CAMPFIRE,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); @@ -1523,7 +1523,7 @@ void content_mapnode_special(bool repeat) f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 3.0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_NC_RB; f = &content_features(i); @@ -1534,7 +1534,7 @@ void content_mapnode_special(bool repeat) f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 3.0; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_FLOWER_POT_RAW; f = &content_features(i); @@ -1554,8 +1554,8 @@ void content_mapnode_special(bool repeat) content_nodebox_flower_pot(f); f->setInventoryTextureNodeBox(i,"flower_pot_raw_top.png","flower_pot_raw.png","flower_pot_raw.png"); crafting::setVRecipe(CONTENT_CRAFTITEM_CLAY,CONTENT_FLOWER_POT_RAW); - lists::add("craftguide",i); - lists::add("cooking",i); + content_list_add("craftguide",i,1,0); + content_list_add("cooking",i,1,0); i = CONTENT_FLOWER_POT; f = &content_features(i); @@ -1572,7 +1572,7 @@ void content_mapnode_special(bool repeat) f->hardness = 0.75; content_nodebox_flower_pot(f); f->setInventoryTextureNodeBox(i,"flower_pot_top.png","flower_pot.png","flower_pot.png"); - lists::add("creative",i); + content_list_add("creative",i,1,0); // walls i = CONTENT_COBBLE_WALL; @@ -1595,8 +1595,8 @@ void content_mapnode_special(bool repeat) f->hardness = 0.9; f->suffocation_per_second = 0; crafting::setWallRecipe(CONTENT_COBBLE,CONTENT_COBBLE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_ROUGHSTONE_WALL; f = &content_features(i); @@ -1618,8 +1618,8 @@ void content_mapnode_special(bool repeat) f->hardness = 0.9; f->suffocation_per_second = 0; crafting::setWallRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_MOSSYCOBBLE_WALL; f = &content_features(i); @@ -1641,8 +1641,8 @@ void content_mapnode_special(bool repeat) f->hardness = 0.8; f->suffocation_per_second = 0; crafting::setWallRecipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONE_WALL; f = &content_features(i); @@ -1664,8 +1664,8 @@ void content_mapnode_special(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setWallRecipe(CONTENT_STONE,CONTENT_STONE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SANDSTONE_WALL; f = &content_features(i); @@ -1687,8 +1687,8 @@ void content_mapnode_special(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setWallRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LIMESTONE_WALL; f = &content_features(i); @@ -1710,8 +1710,8 @@ void content_mapnode_special(bool repeat) f->hardness = 0.9; f->suffocation_per_second = 0; crafting::setWallRecipe(CONTENT_LIMESTONE,CONTENT_LIMESTONE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_MARBLE_WALL; f = &content_features(i); @@ -1733,8 +1733,8 @@ void content_mapnode_special(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setWallRecipe(CONTENT_MARBLE,CONTENT_MARBLE_WALL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TNT; f = &content_features(i); @@ -1753,8 +1753,8 @@ void content_mapnode_special(bool repeat) f->hardness = 1.0; f->suffocation_per_second = 0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_TNT,CONTENT_TNT); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLASH; f = &content_features(i); @@ -1837,8 +1837,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG_BLACK,CONTENT_CRAFTITEM_STARCH,CONTENT_FLAG); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLAG_BLUE; f = &content_features(i); @@ -1861,8 +1861,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_FLAG_BLUE); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLAG_GREEN; f = &content_features(i); @@ -1885,8 +1885,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_FLAG_GREEN); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLAG_ORANGE; f = &content_features(i); @@ -1909,8 +1909,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_FLAG_ORANGE); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLAG_PURPLE; f = &content_features(i); @@ -1933,8 +1933,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_FLAG_PURPLE); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLAG_RED; f = &content_features(i); @@ -1957,8 +1957,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_RED,CONTENT_FLAG_RED); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLAG_YELLOW; f = &content_features(i); @@ -1981,8 +1981,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_FLAG_YELLOW); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_FLAG_BLACK; f = &content_features(i); @@ -2005,8 +2005,8 @@ void content_mapnode_special(bool repeat) crafting::set1Any2Recipe(CONTENT_FLAG,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_FLAG_BLACK); if(f->initial_metadata == NULL) f->initial_metadata = new FlagNodeMetadata(); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LIFE_SUPPORT; f = &content_features(i); @@ -2029,8 +2029,8 @@ void content_mapnode_special(bool repeat) }; crafting::setRecipe(r,CONTENT_LIFE_SUPPORT,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_PARCEL; f = &content_features(i); @@ -2073,8 +2073,8 @@ void content_mapnode_special(bool repeat) f->initial_metadata = new CauldronNodeMetadata(); crafting::setDeepURecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CAULDRON); f->pressure_type = CST_SOLID; - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_FORGE; @@ -2100,8 +2100,8 @@ void content_mapnode_special(bool repeat) crafting::setRecipe(r,CONTENT_FORGE,1); } f->pressure_type = CST_SOLID; - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); f->suffocation_per_second = 0; i = CONTENT_FORGE_FIRE; @@ -2153,7 +2153,7 @@ void content_mapnode_special(bool repeat) }; crafting::setRecipe(r,CONTENT_SCAFFOLDING,1); } - lists::add("cooking",i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("cooking",i,1,0); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); } diff --git a/src/content_mapnode_stair.cpp b/src/content_mapnode_stair.cpp index 0ff2a98..ff3df6f 100644 --- a/src/content_mapnode_stair.cpp +++ b/src/content_mapnode_stair.cpp @@ -47,8 +47,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_ROUGHSTONE_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_COBBLE_STAIR; f = &content_features(i); @@ -65,8 +65,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_COBBLE_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_COBBLE,CONTENT_COBBLE_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_MOSSYCOBBLE_STAIR; f = &content_features(i); @@ -83,8 +83,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_MOSSYCOBBLE_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_STONE_STAIR; f = &content_features(i); @@ -102,8 +102,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_STONE_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_STONE,CONTENT_STONE_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_WOOD_STAIR; f = &content_features(i); @@ -122,8 +122,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_WOOD_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_WOOD,CONTENT_WOOD_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_JUNGLE_STAIR; f = &content_features(i); @@ -142,8 +142,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_JUNGLE_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLE_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_BRICK_STAIR; f = &content_features(i); @@ -165,8 +165,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_BRICK_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_BRICK,CONTENT_BRICK_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_SANDSTONE_STAIR; f = &content_features(i); @@ -183,8 +183,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_SANDSTONE_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_LIMESTONE_STAIR; f = &content_features(i); @@ -201,8 +201,8 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_LIMESTONE_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; crafting::setStairRecipe(CONTENT_LIMESTONE,CONTENT_LIMESTONE_STAIR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); // upside down stairs i = CONTENT_ROUGHSTONE_STAIR_UD; @@ -348,9 +348,9 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_node = CONTENT_LIMESTONE_STAIR_CORNER_UD; f->onpunch_replace_respects_borderstone = true; f->suffocation_per_second = 0; - + // Stairs' corners - + i = CONTENT_ROUGHSTONE_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -367,8 +367,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_ROUGHSTONE_INNER_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_COBBLE_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -385,8 +385,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_COBBLE_INNER_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_MOSSYCOBBLE_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -403,8 +403,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.8; f->onpunch_replace_node = CONTENT_MOSSYCOBBLE_INNER_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_STONE_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -517,9 +517,9 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_LIMESTONE_INNER_STAIR_CORNER; f->onpunch_replace_respects_borderstone = true; - + // Upside down stairs' corners - + i = CONTENT_ROUGHSTONE_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -536,8 +536,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_ROUGHSTONE_INNER_STAIR_CORNER_UD; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_COBBLE_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -553,8 +553,8 @@ void content_mapnode_stair(bool repeat) f->type = CMT_STONE; f->hardness = 0.9; f->onpunch_replace_node = CONTENT_COBBLE_INNER_STAIR_CORNER_UD; - f->onpunch_replace_respects_borderstone = true; - + f->onpunch_replace_respects_borderstone = true; + i = CONTENT_MOSSYCOBBLE_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -571,7 +571,7 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.8; f->onpunch_replace_node = CONTENT_MOSSYCOBBLE_INNER_STAIR_CORNER_UD; f->onpunch_replace_respects_borderstone = true; - + i = CONTENT_STONE_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -683,7 +683,7 @@ void content_mapnode_stair(bool repeat) f->onpunch_replace_respects_borderstone = true; // Inner stairs' corners - + i = CONTENT_ROUGHSTONE_INNER_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -700,7 +700,7 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_ROUGHSTONE_STAIR; f->onpunch_replace_respects_borderstone = true; - + i = CONTENT_COBBLE_INNER_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -717,8 +717,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_COBBLE_STAIR; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_MOSSYCOBBLE_INNER_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -735,7 +735,7 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.8; f->onpunch_replace_node = CONTENT_MOSSYCOBBLE_STAIR; f->onpunch_replace_respects_borderstone = true; - + i = CONTENT_STONE_INNER_STAIR_CORNER; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -847,9 +847,9 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_LIMESTONE_STAIR; f->onpunch_replace_respects_borderstone = true; - + // Upside down inner stairs' corners - + i = CONTENT_ROUGHSTONE_INNER_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -866,8 +866,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_ROUGHSTONE_STAIR_UD; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_COBBLE_INNER_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -884,8 +884,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.9; f->onpunch_replace_node = CONTENT_COBBLE_STAIR_UD; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_MOSSYCOBBLE_INNER_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; @@ -902,8 +902,8 @@ void content_mapnode_stair(bool repeat) f->hardness = 0.8; f->onpunch_replace_node = CONTENT_MOSSYCOBBLE_STAIR_UD; f->onpunch_replace_respects_borderstone = true; - - + + i = CONTENT_STONE_INNER_STAIR_CORNER_UD; f = &content_features(i); f->param_type = CPT_FACEDIR_SIMPLE; diff --git a/src/content_mapnode_util.cpp b/src/content_mapnode_util.cpp index d5699d0..b6074ca 100644 --- a/src/content_mapnode_util.cpp +++ b/src/content_mapnode_util.cpp @@ -47,7 +47,7 @@ void content_nodedef_knob(content_t nodeid, content_t source_node, ContentMateri } content_nodebox_knob(features); features->setInventoryTextureNodeBox(nodeid,texture,texture,texture); - lists::add("craftguide",nodeid); - lists::add("creative",nodeid); + content_list_add("craftguide",nodeid,1,0); + content_list_add("creative",nodeid,1,0); } diff --git a/src/content_mob.cpp b/src/content_mob.cpp index a78d67f..bb62d3a 100644 --- a/src/content_mob.cpp +++ b/src/content_mob.cpp @@ -374,7 +374,7 @@ void content_mob_init() f->spawn_group = 3; f->spawn_naturally = true; f->setCollisionBox(aabb3f(-BS/3.,0.0,-BS/3., BS/3.,BS/2.,BS/3.)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_FIREFLY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -393,7 +393,7 @@ void content_mob_init() f->spawn_max_height = 50; f->spawn_naturally = false; f->setCollisionBox(aabb3f(-BS/4.,-BS/6.,-BS/4., BS/4.,BS/6.,BS/4.)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_OERKKI; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -414,7 +414,7 @@ void content_mob_init() f->attack_player_damage = 15; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-BS/3.,0.0,-BS/3., BS/3.,BS*2.,BS/3.)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_DUNGEON_MASTER; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -435,7 +435,7 @@ void content_mob_init() f->attack_glow_light = LIGHT_MAX-1; f->attack_throw_offset = v3f(0,1.4,-1.0); f->setCollisionBox(aabb3f(-0.75*BS, 0.*BS, -0.75*BS, 0.75*BS, 2.0*BS, 0.75*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_FIREBALL; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -479,7 +479,7 @@ void content_mob_init() f->spawn_max_height = 40; f->spawn_group = 3; f->setCollisionBox(aabb3f(-0.6*BS, 0., -0.6*BS, 0.6*BS, 1.25*BS, 0.6*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_STAG; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -508,7 +508,7 @@ void content_mob_init() f->attack_player_damage = 15; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-0.7*BS, 0., -0.7*BS, 0.7*BS, 1.5*BS, 0.7*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_TAMESTAG; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -557,7 +557,7 @@ void content_mob_init() f->spawn_water = true; f->hp = 5; f->setCollisionBox(aabb3f(-0.25*BS, 0.25*BS, -0.25*BS, 0.25*BS, 0.75*BS, 0.25*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_SHARK; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -582,7 +582,7 @@ void content_mob_init() f->attack_player_damage = 15; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-0.75*BS, 0., -0.75*BS, 0.75*BS, 1.*BS, 0.75*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_WOLF; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -610,7 +610,7 @@ void content_mob_init() f->attack_player_damage = 15; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-0.5*BS, 0., -0.5*BS, 0.5*BS, 1.*BS, 0.5*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_TAMEWOLF; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -636,7 +636,7 @@ void content_mob_init() f->attack_mob_range = v3f(1,1,1); f->spawn_naturally = false; f->setCollisionBox(aabb3f(-0.5*BS, 0., -0.5*BS, 0.5*BS, 1.*BS, 0.5*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_SHEEP; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -668,7 +668,7 @@ void content_mob_init() f->spawn_max_height = 50; f->spawn_group = 4; f->setCollisionBox(aabb3f(-0.4*BS, 0., -0.4*BS, 0.4*BS, 1.*BS, 0.4*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_SHEARED_SHEEP; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -693,7 +693,7 @@ void content_mob_init() f->sound_random_extra = "mob-ducksheep-env"; f->spawn_naturally = false; f->setCollisionBox(aabb3f(-0.4*BS, 0., -0.4*BS, 0.4*BS, 1.*BS, 0.4*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_SNOWBALL; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -756,7 +756,7 @@ void content_mob_init() f->attack_player_damage = 1; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-0.6*BS, 0., -0.6*BS, 0.6*BS, 1.25*BS, 0.6*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_WHITE_KITTY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -783,7 +783,7 @@ void content_mob_init() f->attack_player_damage = 1; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-0.6*BS, 0., -0.6*BS, 0.6*BS, 1.25*BS, 0.6*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_SIAMESE_KITTY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -810,7 +810,7 @@ void content_mob_init() f->attack_player_damage = 1; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-0.6*BS, 0., -0.6*BS, 0.6*BS, 1.25*BS, 0.6*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); i = CONTENT_MOB_GINGER_KITTY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; @@ -837,5 +837,5 @@ void content_mob_init() f->attack_player_damage = 1; f->attack_player_range = v3f(1,1,1); f->setCollisionBox(aabb3f(-0.6*BS, 0., -0.6*BS, 0.6*BS, 1.25*BS, 0.6*BS)); - lists::add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); + content_list_add("creative",CONTENT_TOOLITEM_MOB_SPAWNER,1,i); } diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index fea0621..454bf62 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -37,6 +37,8 @@ #include "enchantment.h" #include +#include "list.h" + /* SignNodeMetadata */ @@ -738,16 +740,26 @@ NodeMetadata* CreativeChestNodeMetadata::create(std::istream &is) } NodeMetadata* CreativeChestNodeMetadata::clone() { + contentlist_t *cl; + listdata_t *ld; CreativeChestNodeMetadata *d = new CreativeChestNodeMetadata(); + *d->m_inventory = *m_inventory; InventoryList *l = d->m_inventory->getList("0"); InventoryItem *t; l->clearItems(); - std::vector &list = lists::get("creative"); - for (u16 i=0; idata; + while (ld) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); l->addItem(t); + ld = ld->next; } + return d; } void CreativeChestNodeMetadata::serializeBody(std::ostream &os) @@ -765,47 +777,74 @@ bool CreativeChestNodeMetadata::nodeRemovalDisabled() } bool CreativeChestNodeMetadata::receiveFields(std::string formname, std::map fields, Player *player) { + contentlist_t *cl; + listdata_t *ld; + uint32_t list_size = 0; + uint32_t start; + uint32_t end; + uint32_t i; + if (fields["prev"] == "" && fields["next"] == "") return false; - std::vector &list = lists::get("creative"); + + cl = content_list_get("creative"); + if (!cl) + return false; + + list_size = list_count(&cl->data); + if (fields["prev"] != "") { if (m_page > 0) { m_page--; }else{ - m_page = list.size()/32; + m_page = list_size/32; } } if (fields["next"] != "") m_page++; if (m_page < 0) m_page = 0; - if (m_page > (list.size()/32)) + if (m_page > (list_size/32)) m_page = 0; InventoryList *l = m_inventory->getList("0"); InventoryItem *t; l->clearItems(); - u16 start = m_page*32; - u16 end = start+32; - if (end > list.size()) - end = list.size(); - for (u16 i=start; iaddItem(t); + + start = m_page*32; + end = start+32; + + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + l->addItem(t); + } + ld = ld->next; } + return true; } std::string CreativeChestNodeMetadata::getDrawSpecString(Player *player) { - wchar_t buff[256]; - std::vector &list = lists::get("creative"); - swprintf(buff, 256, wgettext("Page %d of %d"),(int)(m_page+1),(int)((list.size()/32)+1)); + char buff[256]; + contentlist_t *cl; + uint32_t list_size = 0; + + cl = content_list_get("creative"); + if (cl) + list_size = list_count(&cl->data); + + snprintf(buff,256,gettext("Page %d of %d"),(int)(m_page+1),(int)((list_size/32)+1)); std::string spec("size[8,10]"); spec += "list[current_name;0;0,0.5;8,4;]"; spec += "button[0.25,5;2.5,0.75;prev;"; spec += wide_to_narrow(wgettext("<< Previous Page")); spec += "]"; spec += "label[3.5,5;"; - spec += wide_to_narrow(buff); + spec += buff; spec += "]"; spec += "button[6,5;2.5,0.75;next;"; spec += wide_to_narrow(wgettext("Next Page >>")); @@ -1932,27 +1971,51 @@ u16 CraftGuideNodeMetadata::typeId() const } NodeMetadata* CraftGuideNodeMetadata::clone() { - CraftGuideNodeMetadata *d = new CraftGuideNodeMetadata(); - *d->m_inventory = *m_inventory; - d->m_page = m_page; - InventoryList *l = d->m_inventory->getList("list"); + contentlist_t *cl; + listdata_t *ld; + InventoryList *l; InventoryItem *t; content_t *r; + uint32_t list_size = 0; + uint32_t start; + uint32_t end; + uint32_t i; + CraftGuideNodeMetadata *d = new CraftGuideNodeMetadata(); + + *d->m_inventory = *m_inventory; + d->m_page = m_page; + + l = d->m_inventory->getList("list"); l->clearItems(); - std::vector &list = lists::get("craftguide"); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; idata); + + start = m_page*40; + end = start+40; + + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + r = crafting::getRecipe(t); + if (!r) { + delete t; + ld = ld->next; + continue; + } + l->addItem(t); } - l->addItem(t); + ld = ld->next; } + return d; } NodeMetadata* CraftGuideNodeMetadata::create(std::istream &is) @@ -2010,37 +2073,71 @@ bool CraftGuideNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env } bool CraftGuideNodeMetadata::import(NodeMetadata *meta) { + contentlist_t *cl; + listdata_t *ld; + InventoryList *l; + InventoryItem *t; + content_t *r; + uint32_t list_size = 0; + uint32_t start; + uint32_t end; + uint32_t i; + if (meta->typeId() == CONTENT_BOOK) m_page = ((ClosedBookNodeMetadata*)meta)->getPage(); if (m_page < 0) m_page = 0; - std::vector &list = lists::get("craftguide"); - if (m_page > (list.size()/40)) - m_page = list.size()/40; - InventoryList *l = m_inventory->getList("list"); - InventoryItem *t; - content_t *r; + + cl = content_list_get("craftguide"); + + if (!cl) + return false; + + list_size = list_count(&cl->data); + + if (m_page > (list_size/40)) + m_page = list_size/40; + + start = m_page*40; + end = start+40; + + l = m_inventory->getList("list"); l->clearItems(); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; i list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + r = crafting::getRecipe(t); + if (!r) { + delete t; + ld = ld->next; + continue; + } + l->addItem(t); } - l->addItem(t); + ld = ld->next; } + return true; } bool CraftGuideNodeMetadata::receiveFields(std::string formname, std::map fields, Player *player) { - InventoryList *l = m_inventory->getList("list"); + InventoryList *l; InventoryItem *t; + contentlist_t *cl; + listdata_t *ld; + content_t *r; + uint32_t list_size; + uint32_t start; + uint32_t end; + uint32_t i; + + l = m_inventory->getList("list"); if (fields["rprev"] != "" || fields["rnext"] != "") { l = m_inventory->getList("result"); t = l->getItem(0); @@ -2060,33 +2157,48 @@ bool CraftGuideNodeMetadata::receiveFields(std::string formname, std::map &list = lists::get("craftguide"); + + cl = content_list_get("craftguide"); + + if (!cl) + return false; + + list_size = list_count(&cl->data); + if (fields["prev"] != "") { if (m_page > 0) { m_page--; }else{ - m_page = list.size()/40; + m_page = list_size/40; } } if (fields["next"] != "") m_page++; - if (m_page > (list.size()/40)) + if (m_page > (list_size/40)) m_page = 0; - content_t *r; + l->clearItems(); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; i list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + r = crafting::getRecipe(t); + if (!r) { + delete t; + ld = ld->next; + continue; + } + l->addItem(t); } - l->addItem(t); + ld = ld->next; } + return true; } std::string CraftGuideNodeMetadata::getDrawSpecString(Player *player) @@ -2095,14 +2207,20 @@ std::string CraftGuideNodeMetadata::getDrawSpecString(Player *player) InventoryItem *q = l->getItem(0); int tr = 0; int rc = 0; - std::vector &list = lists::get("craftguide"); + char buff[256]; + uint32_t list_size = 0; + contentlist_t *cl; + + cl = content_list_get("craftguide"); + if (cl) + list_size = list_count(&cl->data); + if (q && q->getContent() != CONTENT_IGNORE) { tr = crafting::getResultCount(q); rc = crafting::getRecipeCount(q); } - wchar_t buff[256]; - swprintf(buff, 256, wgettext("Page %d of %d"), (int)(m_page+1), (int)((list.size()/40)+1)); + snprintf(buff,256,gettext("Page %d of %d"),(int)(m_page+1),(int)((list_size/40)+1)); std::string spec("size[8,10]"); spec += "label[0.5,0.75;"; @@ -2133,7 +2251,7 @@ std::string CraftGuideNodeMetadata::getDrawSpecString(Player *player) spec += wide_to_narrow(wgettext("<< Previous Page")); spec += "]"; spec += "label[3.5,4.5;"; - spec += wide_to_narrow(buff); + spec += buff; spec += "]"; spec += "button[6,4.5;2.5,0.75;next;"; spec += wide_to_narrow(wgettext("Next Page >>")); @@ -2449,28 +2567,52 @@ u16 CookBookNodeMetadata::typeId() const } NodeMetadata* CookBookNodeMetadata::clone() { + InventoryList *l; + InventoryItem *t; + InventoryItem *r; + contentlist_t *cl; + listdata_t *ld; + uint32_t list_size; + uint32_t start; + uint32_t end; + uint32_t i; + CookBookNodeMetadata *d = new CookBookNodeMetadata(); *d->m_inventory = *m_inventory; d->m_page = m_page; - InventoryList *l = d->m_inventory->getList("list"); - InventoryItem *t; + + l = d->m_inventory->getList("list"); l->clearItems(); - std::vector &list = lists::get("cooking"); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; icreateCookResult(); - if (!cookresult || cookresult->getContent() == CONTENT_IGNORE) { - delete t; - delete cookresult; - continue; + + cl = content_list_get("cooking"); + if (!cl) + return d; + + list_size = list_count(&cl->data); + + start = m_page*40; + end = start+40; + + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + r = t->createCookResult(); + if (!r || r->getContent() == CONTENT_IGNORE) { + delete t; + delete r; + ld = ld->next; + continue; + } + delete r; + l->addItem(t); } - delete cookresult; - l->addItem(t); + ld = ld->next; } + return d; } NodeMetadata* CookBookNodeMetadata::create(std::istream &is) @@ -2512,76 +2654,130 @@ bool CookBookNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env) } bool CookBookNodeMetadata::import(NodeMetadata *meta) { + InventoryList *l; + InventoryItem *t; + InventoryItem *r; + contentlist_t *cl; + listdata_t *ld; + uint32_t list_size; + uint32_t start; + uint32_t end; + uint32_t i; + if (meta->typeId() == CONTENT_BOOK) m_page = ((ClosedBookNodeMetadata*)meta)->getPage(); if (m_page < 0) m_page = 0; - std::vector &list = lists::get("cooking"); - if (m_page > (list.size()/40)) - m_page = list.size()/40; - InventoryList *l = m_inventory->getList("list"); - InventoryItem *t; + + cl = content_list_get("cooking"); + if (!cl) + return true; + + list_size = list_count(&cl->data); + + if (m_page > (list_size/40)) + m_page = list_size/40; + + l = m_inventory->getList("list"); l->clearItems(); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; icreateCookResult(); - if (!cookresult || cookresult->getContent() == CONTENT_IGNORE) { - delete t; - delete cookresult; - continue; + + start = m_page*40; + end = start+40; + + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + r = t->createCookResult(); + if (!r || r->getContent() == CONTENT_IGNORE) { + delete t; + delete r; + ld = ld->next; + continue; + } + delete r; + l->addItem(t); } - delete cookresult; - l->addItem(t); + ld = ld->next; } + return true; } bool CookBookNodeMetadata::receiveFields(std::string formname, std::map fields, Player *player) { + InventoryList *l; + InventoryItem *t; + InventoryItem *r; + contentlist_t *cl; + listdata_t *ld; + uint32_t list_size; + uint32_t start; + uint32_t end; + uint32_t i; + if (fields["prev"] == "" && fields["next"] == "") return false; - std::vector &list = lists::get("cooking"); + + cl = content_list_get("cooking"); + if (!cl) + return false; + + list_size = list_count(&cl->data); + if (fields["prev"] != "") { if (m_page > 0) { m_page--; }else{ - m_page = list.size()/40; + m_page = list_size/40; } } if (fields["next"] != "") m_page++; - if (m_page > (list.size()/40)) + if (m_page > (list_size/40)) m_page = 0; - InventoryList *l = m_inventory->getList("list"); - InventoryItem *t; + + l = m_inventory->getList("list"); l->clearItems(); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; icreateCookResult(); - if (!cookresult || cookresult->getContent() == CONTENT_IGNORE) { - delete t; - delete cookresult; - continue; + + start = m_page*40; + end = start+40; + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + r = t->createCookResult(); + if (!r || r->getContent() == CONTENT_IGNORE) { + delete t; + delete r; + ld = ld->next; + continue; + } + delete r; + l->addItem(t); } - delete cookresult; - l->addItem(t); + ld = ld->next; } + return true; } std::string CookBookNodeMetadata::getDrawSpecString(Player *player) { - std::vector &list = lists::get("cooking"); + char buff[256]; + contentlist_t *cl; + uint32_t list_size = 0; - wchar_t buff[256]; - swprintf(buff, 256, wgettext("Page %d of %d"), (int)(m_page+1), (int)((list.size()/40)+1)); + cl = content_list_get("cooking"); + if (cl) + list_size = list_count(&cl->data); + + snprintf(buff,256,gettext("Page %d of %d"),(int)(m_page+1),(int)((list_size/40)+1)); std::string spec("size[8,9]"); spec += "label[0.5,0.75;"; @@ -2593,7 +2789,7 @@ std::string CookBookNodeMetadata::getDrawSpecString(Player *player) spec += wide_to_narrow(wgettext("<< Previous Page")); spec += "]"; spec += "label[3.5,3.5;"; - spec += wide_to_narrow(buff); + spec += buff; spec += "]"; spec += "button[6,3.5;2.5,0.75;next;"; spec += wide_to_narrow(wgettext("Next Page >>")); @@ -2631,30 +2827,53 @@ u16 DeCraftNodeMetadata::typeId() const } NodeMetadata* DeCraftNodeMetadata::clone() { + InventoryList *l; + InventoryItem *t; + contentlist_t *cl; + listdata_t *ld; + uint32_t list_size; + uint32_t start; + uint32_t end; + uint32_t i; + ContentFeatures *f; + DeCraftNodeMetadata *d = new DeCraftNodeMetadata(); *d->m_inventory = *m_inventory; d->m_page = m_page; - InventoryList *l = d->m_inventory->getList("list"); - InventoryItem *t; - l->clearItems(); - std::vector &list = lists::get("decrafting"); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; iaddItem(t); + l = d->m_inventory->getList("list"); + l->clearItems(); + + cl = content_list_get("decrafting"); + if (!cl) + return d; + + list_size = list_count(&cl->data); + + start = m_page*40; + end = start+40; + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + if ((ld->content&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) + continue; + if ((ld->content&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) + continue; + if ((ld->content&CONTENT_CLOTHESITEM_MASK) == CONTENT_CLOTHESITEM_MASK) + continue; + f = &content_features(ld->content); + if (!f || (f->dug_item == "" && f->extra_dug_item == "")) + continue; + + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + l->addItem(t); + } + ld = ld->next; } + return d; } NodeMetadata* DeCraftNodeMetadata::create(std::istream &is) @@ -2723,79 +2942,133 @@ bool DeCraftNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env) } bool DeCraftNodeMetadata::import(NodeMetadata *meta) { + InventoryList *l; + InventoryItem *t; + contentlist_t *cl; + listdata_t *ld; + uint32_t list_size; + uint32_t start; + uint32_t end; + uint32_t i; + ContentFeatures *f; + if (meta->typeId() == CONTENT_BOOK) m_page = ((ClosedBookNodeMetadata*)meta)->getPage(); if (m_page < 0) m_page = 0; - std::vector &list = lists::get("decrafting"); - if (m_page > (list.size()/40)) - m_page = list.size()/40; - InventoryList *l = m_inventory->getList("list"); - InventoryItem *t; - l->clearItems(); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; iaddItem(t); + l = m_inventory->getList("list"); + l->clearItems(); + + cl = content_list_get("decrafting"); + if (!cl) + return true; + + list_size = list_count(&cl->data); + + if (m_page > (list_size/40)) + m_page = list_size/40; + + start = m_page*40; + end = start+40; + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + if ((ld->content&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) + continue; + if ((ld->content&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) + continue; + if ((ld->content&CONTENT_CLOTHESITEM_MASK) == CONTENT_CLOTHESITEM_MASK) + continue; + f = &content_features(ld->content); + if (!f || (f->dug_item == "" && f->extra_dug_item == "")) + continue; + + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + l->addItem(t); + } + ld = ld->next; } + return true; } bool DeCraftNodeMetadata::receiveFields(std::string formname, std::map fields, Player *player) { + InventoryList *l; + InventoryItem *t; + contentlist_t *cl; + listdata_t *ld; + uint32_t list_size; + uint32_t start; + uint32_t end; + uint32_t i; + ContentFeatures *f; + if (fields["prev"] == "" && fields["next"] == "") return false; - std::vector &list = lists::get("decrafting"); + + cl = content_list_get("decrafting"); + if (!cl) + return false; + + list_size = list_count(&cl->data); + if (fields["prev"] != "") { if (m_page > 0) { m_page--; }else{ - m_page = list.size()/40; + m_page = list_size/40; } } if (fields["next"] != "") m_page++; - if (m_page > (list.size()/40)) + if (m_page > (list_size/40)) m_page = 0; - InventoryList *l = m_inventory->getList("list"); - InventoryItem *t; - l->clearItems(); - u16 start = m_page*40; - u16 end = start+40; - if (end > list.size()) - end = list.size(); - for (int i=start; iaddItem(t); + l = m_inventory->getList("list"); + l->clearItems(); + + start = m_page*40; + end = start+40; + if (end > list_size) + end = list_size; + + ld = cl->data; + for (i=0; ld && i= start) { + if ((ld->content&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) + continue; + if ((ld->content&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) + continue; + if ((ld->content&CONTENT_CLOTHESITEM_MASK) == CONTENT_CLOTHESITEM_MASK) + continue; + f = &content_features(ld->content); + if (!f || (f->dug_item == "" && f->extra_dug_item == "")) + continue; + + t = InventoryItem::create(ld->content,ld->count,0,ld->data); + l->addItem(t); + } + ld = ld->next; } + return true; } std::string DeCraftNodeMetadata::getDrawSpecString(Player *player) { - std::vector &list = lists::get("decrafting"); - wchar_t buff[256]; - swprintf(buff, 256, wgettext("Page %d of %d"), (int)(m_page+1), (int)((list.size()/40)+1)); + char buff[256]; + contentlist_t *cl; + uint32_t list_size = 0; + + cl = content_list_get("decrafting"); + if (cl) + list_size = list_count(&cl->data); + + snprintf(buff,256,gettext("Page %d of %d"),(int)(m_page+1),(int)((list_size/40)+1)); std::string spec("size[8,9]"); spec += "label[0.5,0.75;"; @@ -2814,7 +3087,7 @@ std::string DeCraftNodeMetadata::getDrawSpecString(Player *player) spec += wide_to_narrow(wgettext("<< Previous Page")); spec += "]"; spec += "label[3.5,3.5;"; - spec += wide_to_narrow(buff); + spec += buff; spec += "]"; spec += "button[6,3.5;2.5,0.75;next;"; spec += wide_to_narrow(wgettext("Next Page >>")); diff --git a/src/content_sao.cpp b/src/content_sao.cpp index fd8f20e..2c216fa 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1445,11 +1445,11 @@ bool MobSAO::rightClick(Player *player) content_t c = item->getContent(); if ((c&CONTENT_CRAFTITEM_MASK) != CONTENT_CRAFTITEM_MASK) return false; - CraftItemFeatures f = content_craftitem_features(c); - if (f.content != c) + CraftItemFeatures *f = content_craftitem_features(c); + if (f->content != c) return false; // and edible - if (!f.consumable || !f.hunger_effect) + if (!f->consumable || !f->hunger_effect) return false; // feed the mob // after this always return true as inventory has been modified diff --git a/src/content_toolitem.cpp b/src/content_toolitem.cpp index 45e16b1..d83690e 100644 --- a/src/content_toolitem.cpp +++ b/src/content_toolitem.cpp @@ -292,8 +292,8 @@ void content_toolitem_init() r[4] = CONTENT_CRAFTITEM_JUNGLE_PLANK; crafting::setRecipe(r,i,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STONEPICK; f = &g_content_toolitem_features[i]; @@ -306,8 +306,8 @@ void content_toolitem_init() f->diginfo.time = 1.5; f->diginfo.level = 2; crafting::setPickRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STONEPICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_FLINTPICK; f = &g_content_toolitem_features[i]; @@ -320,8 +320,8 @@ void content_toolitem_init() f->diginfo.time = 1.75; f->diginfo.level = 2; crafting::setPickRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTPICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELPICK; f = &g_content_toolitem_features[i]; @@ -334,8 +334,8 @@ void content_toolitem_init() f->diginfo.time = 1.0; f->diginfo.level = 3; crafting::setPickRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELPICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_RAW_PICK; f = &g_content_toolitem_features[i]; @@ -348,8 +348,8 @@ void content_toolitem_init() f->diginfo.time = 0.75; f->diginfo.level = 4; crafting::setPickRecipe(CONTENT_CRAFTITEM_MITHRIL_RAW,CONTENT_TOOLITEM_MITHRIL_RAW_PICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_PICK; f = &g_content_toolitem_features[i]; @@ -362,8 +362,8 @@ void content_toolitem_init() f->diginfo.time = 0.6; f->diginfo.level = 5; crafting::setPickRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_PICK); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_PICK; f = &g_content_toolitem_features[i]; @@ -378,7 +378,7 @@ void content_toolitem_init() f->diginfo.level = 5; f->has_punch_effect = false; crafting::setPickRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_PICK); - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); i = CONTENT_TOOLITEM_CREATIVEPICK; f = &g_content_toolitem_features[i]; @@ -391,8 +391,8 @@ void content_toolitem_init() f->diginfo.time = 0.1; f->diginfo.level = 4; f->has_punch_effect = false; - lists::add("player-creative",i); - lists::add("creative",i); + content_list_add("player-creative",i,1,0); + content_list_add("creative",i,1,0); /* SHOVELS */ @@ -407,8 +407,8 @@ void content_toolitem_init() f->diginfo.time = 3.0; f->diginfo.level = 1; crafting::set1over1Recipe(CONTENT_ROCK,CONTENT_CRAFTITEM_STICK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STONESHOVEL; f = &g_content_toolitem_features[i]; @@ -421,8 +421,8 @@ void content_toolitem_init() f->diginfo.time = 1.5; f->diginfo.level = 1; crafting::setShovelRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STONESHOVEL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_FLINTSHOVEL; f = &g_content_toolitem_features[i]; @@ -435,8 +435,8 @@ void content_toolitem_init() f->diginfo.time = 1.75; f->diginfo.level = 2; crafting::setShovelRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTSHOVEL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELSHOVEL; f = &g_content_toolitem_features[i]; @@ -449,8 +449,8 @@ void content_toolitem_init() f->diginfo.time = 1.0; f->diginfo.level = 3; crafting::setShovelRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHOVEL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_RAW_SHOVEL; f = &g_content_toolitem_features[i]; @@ -463,8 +463,8 @@ void content_toolitem_init() f->diginfo.time = 0.75; f->diginfo.level = 4; crafting::setShovelRecipe(CONTENT_CRAFTITEM_MITHRIL_RAW,CONTENT_TOOLITEM_MITHRIL_RAW_SHOVEL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_SHOVEL; f = &g_content_toolitem_features[i]; @@ -477,8 +477,8 @@ void content_toolitem_init() f->diginfo.time = 0.6; f->diginfo.level = 5; crafting::setShovelRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_SHOVEL); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_SHOVEL; f = &g_content_toolitem_features[i]; @@ -492,7 +492,7 @@ void content_toolitem_init() f->diginfo.time = 0.4; f->diginfo.level = 5; crafting::setShovelRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_SHOVEL); - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); /* AXES */ @@ -517,8 +517,8 @@ void content_toolitem_init() r[0] = CONTENT_IGNORE; r[2] = CONTENT_ROCK; crafting::setRecipe(r,i,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STONEAXE; f = &g_content_toolitem_features[i]; @@ -531,8 +531,8 @@ void content_toolitem_init() f->diginfo.time = 1.5; f->diginfo.level = 1; crafting::setAxeRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STONEAXE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_FLINTAXE; f = &g_content_toolitem_features[i]; @@ -545,8 +545,8 @@ void content_toolitem_init() f->diginfo.time = 1.75; f->diginfo.level = 2; crafting::setAxeRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTAXE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELAXE; f = &g_content_toolitem_features[i]; @@ -559,8 +559,8 @@ void content_toolitem_init() f->diginfo.time = 1.0; f->diginfo.level = 3; crafting::setAxeRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELAXE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_RAW_AXE; f = &g_content_toolitem_features[i]; @@ -573,8 +573,8 @@ void content_toolitem_init() f->diginfo.time = 0.75; f->diginfo.level = 4; crafting::setAxeRecipe(CONTENT_CRAFTITEM_MITHRIL_RAW,CONTENT_TOOLITEM_MITHRIL_RAW_AXE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_AXE; f = &g_content_toolitem_features[i]; @@ -587,8 +587,8 @@ void content_toolitem_init() f->diginfo.time = 0.6; f->diginfo.level = 5; crafting::setAxeRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_AXE); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_AXE; f = &g_content_toolitem_features[i]; @@ -602,7 +602,7 @@ void content_toolitem_init() f->diginfo.time = 0.4; f->diginfo.level = 5; crafting::setAxeRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_AXE); - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); /* WEAPONS - CLUBS, BOWS */ @@ -618,8 +618,8 @@ void content_toolitem_init() f->diginfo.level = 1; crafting::setCol1Recipe(CONTENT_CRAFTITEM_WOOD_PLANK,i); crafting::setCol1Recipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,i); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_BOW; f = &g_content_toolitem_features[i]; @@ -640,8 +640,8 @@ void content_toolitem_init() }; crafting::setRecipe(r,i,1); } - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); /* SPEARS */ @@ -656,8 +656,8 @@ void content_toolitem_init() f->diginfo.time = 1.5; f->diginfo.level = 1; crafting::setSpearRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STONESPEAR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_FLINTSPEAR; f = &g_content_toolitem_features[i]; @@ -670,8 +670,8 @@ void content_toolitem_init() f->diginfo.time = 1.75; f->diginfo.level = 2; crafting::setSpearRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTSPEAR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELSPEAR; f = &g_content_toolitem_features[i]; @@ -684,8 +684,8 @@ void content_toolitem_init() f->diginfo.time = 1.0; f->diginfo.level = 3; crafting::setSpearRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSPEAR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_RAW_SPEAR; f = &g_content_toolitem_features[i]; @@ -698,8 +698,8 @@ void content_toolitem_init() f->diginfo.time = 0.75; f->diginfo.level = 4; crafting::setSpearRecipe(CONTENT_CRAFTITEM_MITHRIL_RAW,CONTENT_TOOLITEM_MITHRIL_RAW_SPEAR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_SPEAR; f = &g_content_toolitem_features[i]; @@ -712,8 +712,8 @@ void content_toolitem_init() f->diginfo.time = 0.6; f->diginfo.level = 5; crafting::setSpearRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_SPEAR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_SPEAR; f = &g_content_toolitem_features[i]; @@ -727,7 +727,7 @@ void content_toolitem_init() f->diginfo.time = 0.4; f->diginfo.level = 5; crafting::setSpearRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_SPEAR); - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); /* SWORDS */ @@ -742,8 +742,8 @@ void content_toolitem_init() f->diginfo.time = 1.5; f->diginfo.level = 1; crafting::setSwordRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STONESWORD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELSWORD; f = &g_content_toolitem_features[i]; @@ -756,8 +756,8 @@ void content_toolitem_init() f->diginfo.time = 1.0; f->diginfo.level = 3; crafting::setSwordRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSWORD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_RAW_SWORD; f = &g_content_toolitem_features[i]; @@ -770,8 +770,8 @@ void content_toolitem_init() f->diginfo.time = 0.75; f->diginfo.level = 4; crafting::setSwordRecipe(CONTENT_CRAFTITEM_MITHRIL_RAW,CONTENT_TOOLITEM_MITHRIL_RAW_SWORD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_UNBOUND_SWORD; f = &g_content_toolitem_features[i]; @@ -784,8 +784,8 @@ void content_toolitem_init() f->diginfo.time = 0.6; f->diginfo.level = 5; crafting::setSwordRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_TOOLITEM_MITHRIL_UNBOUND_SWORD); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_SWORD; f = &g_content_toolitem_features[i]; @@ -799,7 +799,7 @@ void content_toolitem_init() f->diginfo.time = 0.4; f->diginfo.level = 5; crafting::setSwordRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_TOOLITEM_MITHRIL_SWORD); - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); /* SHEARS */ @@ -814,8 +814,8 @@ void content_toolitem_init() f->diginfo.time = 1.5; f->diginfo.level = 2; crafting::setShearsRecipe(CONTENT_CRAFTITEM_FLINT,CONTENT_TOOLITEM_FLINTSHEARS); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELSHEARS; f = &g_content_toolitem_features[i]; @@ -828,8 +828,8 @@ void content_toolitem_init() f->diginfo.time = 1.0; f->diginfo.level = 2; crafting::setShearsRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHEARS); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); /* BUCKETS */ @@ -847,8 +847,8 @@ void content_toolitem_init() f->damaging_nodes_diggable = false; crafting::setURecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_TOOLITEM_WBUCKET); crafting::setURecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_TOOLITEM_WBUCKET); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_TINBUCKET; f = &g_content_toolitem_features[i]; @@ -863,8 +863,8 @@ void content_toolitem_init() f->diginfo.level = 2; f->damaging_nodes_diggable = false; crafting::setURecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TOOLITEM_TINBUCKET); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELBUCKET; f = &g_content_toolitem_features[i]; @@ -878,8 +878,8 @@ void content_toolitem_init() f->diginfo.time = 1.0; f->diginfo.level = 3; crafting::setURecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELBUCKET); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_WBUCKET_WATER; f = &g_content_toolitem_features[i]; @@ -890,7 +890,7 @@ void content_toolitem_init() f->type = TT_SPECIAL; f->onplace_node = CONTENT_WATERSOURCE; f->onplace_replace_item = CONTENT_TOOLITEM_WBUCKET; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_TINBUCKET_WATER; f = &g_content_toolitem_features[i]; @@ -901,7 +901,7 @@ void content_toolitem_init() f->type = TT_SPECIAL; f->onplace_node = CONTENT_WATERSOURCE; f->onplace_replace_item = CONTENT_TOOLITEM_TINBUCKET; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELBUCKET_WATER; f = &g_content_toolitem_features[i]; @@ -912,7 +912,7 @@ void content_toolitem_init() f->type = TT_SPECIAL; f->onplace_node = CONTENT_WATERSOURCE; f->onplace_replace_item = CONTENT_TOOLITEM_STEELBUCKET; - lists::add("creative",i); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_STEELBUCKET_LAVA; f = &g_content_toolitem_features[i]; @@ -924,7 +924,7 @@ void content_toolitem_init() f->onplace_replace_item = CONTENT_TOOLITEM_STEELBUCKET; f->fuel_time = 80; f->type = TT_SPECIAL; - lists::add("creative",i); + content_list_add("creative",i,1,0); /* SPECIAL TOOLS */ @@ -939,8 +939,8 @@ void content_toolitem_init() f->diginfo.level = 3; f->has_fire_effect = true; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_FIRESTARTER); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_CROWBAR; f = &g_content_toolitem_features[i]; @@ -952,8 +952,8 @@ void content_toolitem_init() f->diginfo.level = 3; f->has_rotate_effect = true; crafting::set1over1Recipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_CROWBAR); - lists::add("craftguide",i); - lists::add("creative",i); + content_list_add("craftguide",i,1,0); + content_list_add("creative",i,1,0); i = CONTENT_TOOLITEM_KEY; f = &g_content_toolitem_features[i]; @@ -965,7 +965,7 @@ void content_toolitem_init() f->diginfo.level = 4; f->has_unlock_effect = true; crafting::set1To1Recipe(CONTENT_CRAFTITEM_GOLD_INGOT,CONTENT_TOOLITEM_KEY); - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); i = CONTENT_TOOLITEM_MITHRIL_KEY; f = &g_content_toolitem_features[i]; @@ -1004,5 +1004,5 @@ void content_toolitem_init() }; crafting::setRecipe(r,i,1); } - lists::add("craftguide",i); + content_list_add("craftguide",i,1,0); } diff --git a/src/crypto.c b/src/crypto.c index ed2103b..3cb235b 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -23,10 +23,10 @@ #include /* defined in base64.c */ -int base64_lencode(char *source, size_t sourcelen, char *target, size_t targetlen); -size_t base64_ldecode(char *source, char *target, size_t targetlen); +int base64_lencode(const char* source, size_t sourcelen, char *target, size_t targetlen); +size_t base64_ldecode(const char* source, char *target, size_t targetlen); -uint32_t hash(char *str_param) +uint32_t hash(const char *str_param) { uint32_t hval = 0; uint32_t g; @@ -46,7 +46,7 @@ uint32_t hash(char *str_param) } /* base64 encode a string */ -char* base64_encode(char* str) +char* base64_encode(const char* str) { int sl; int tl; @@ -72,7 +72,7 @@ char* base64_encode(char* str) } /* decode a base64 string */ -char* base64_decode(char* str) +char* base64_decode(const char* str) { int sl; int tl; diff --git a/src/crypto.h b/src/crypto.h index 3be1441..d396b8f 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -7,9 +7,9 @@ extern "C" { #include -uint32_t hash(char* str); -char* base64_encode(char* str); -char* base64_decode(char* str); +uint32_t hash(const char* str); +char* base64_encode(const char* str); +char* base64_decode(const char* str); #ifdef __cplusplus } diff --git a/src/crypto_base64.c b/src/crypto_base64.c index 617cd04..7bbf073 100644 --- a/src/crypto_base64.c +++ b/src/crypto_base64.c @@ -121,7 +121,7 @@ static int s_base64_decode_triple(unsigned char quadruple[4], unsigned char *res } /* encode an array of bytes using base64 */ -int base64_lencode(char *source, size_t sourcelen, char *target, size_t targetlen) +int base64_lencode(const char* source, size_t sourcelen, char *target, size_t targetlen) { /* check if the result will fit in the target buffer */ if ((sourcelen+2)/3*4 > targetlen-1) @@ -155,7 +155,7 @@ int base64_lencode(char *source, size_t sourcelen, char *target, size_t targetle } /* decode base64 encoded data */ -size_t base64_ldecode(char *source, char *target, size_t targetlen) +size_t base64_ldecode(const char* source, char *target, size_t targetlen) { char *src, *tmpptr; char quadruple[4], tmpresult[3]; diff --git a/src/game.cpp b/src/game.cpp index ee52676..a0c118f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1550,7 +1550,7 @@ void the_game( }else if ( wield && ( - content_craftitem_features(wield->getContent()).thrown_item != CONTENT_IGNORE + content_craftitem_features(wield->getContent())->thrown_item != CONTENT_IGNORE || ( content_toolitem_features(wield->getContent()).thrown_item != CONTENT_IGNORE && (ilist = client.getLocalPlayer()->inventory.getList("main")) != NULL diff --git a/src/inventory.cpp b/src/inventory.cpp index cda305c..f630860 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -94,12 +94,10 @@ content_t InventoryItem::info(std::istream &is, u16 *count, u16 *wear, u16 *data if (material > MAX_CONTENT) throw SerializationError("Too large material number"); c = material; - }else if(name == "CraftItem") { + }else if(name == "CraftItem") { /* deprecated */ std::string subname; std::getline(is, subname, ' '); is>>(*count); - CraftItem itm(subname, *count, 0); - c = itm.getContent(); }else if(name == "CraftItem2") { u16 material; is>>material; @@ -309,14 +307,14 @@ video::ITexture * CraftItem::getImage() const if(g_texturesource == NULL) return NULL; - std::string name = content_craftitem_features(m_content).texture; - std::string base = content_craftitem_features(m_content).overlay_base; + std::string name = content_craftitem_features(m_content)->texture; + std::string base = content_craftitem_features(m_content)->overlay_base; std::ostringstream os; os<param_type == CPT_ENCHANTMENT) { EnchantmentInfo info; u16 data = m_data; // TODO: adding more than 2 overlays messes up alpha @@ -333,12 +331,12 @@ video::ITexture * CraftItem::getImage() const #endif std::wstring CraftItem::getGuiName() { - return content_craftitem_features(m_content).description; + return content_craftitem_features(m_content)->description; } std::wstring CraftItem::getGuiText() { std::wstring txt(L" "); - CraftItemFeatures *f = &content_craftitem_features(m_content); + CraftItemFeatures *f = content_craftitem_features(m_content); txt += f->description; if (f->consumable || f->cook_result != CONTENT_IGNORE || f->fuel_time != 0.0) txt += L"\n"; @@ -388,7 +386,7 @@ std::wstring CraftItem::getGuiText() txt += narrow_to_wide(buff); } if (m_data > 0) { - if (content_craftitem_features(m_content).param_type == CPT_ENCHANTMENT) { + if (content_craftitem_features(m_content)->param_type == CPT_ENCHANTMENT) { EnchantmentInfo info; u16 data = m_data; txt += L"\n"; @@ -406,8 +404,8 @@ std::wstring CraftItem::getGuiText() ServerActiveObject* CraftItem::createSAO(ServerEnvironment *env, u16 id, v3f pos) { - content_t drop = content_craftitem_features(m_content).drop_item; - if (content_craftitem_features(m_content).param_type == CPT_DROP && m_data != 0) + content_t drop = content_craftitem_features(m_content)->drop_item; + if (content_craftitem_features(m_content)->param_type == CPT_DROP && m_data != 0) drop = m_data; // Special cases if ((drop&CONTENT_MOB_MASK) == CONTENT_MOB_MASK) { @@ -424,7 +422,7 @@ ServerActiveObject* CraftItem::createSAO(ServerEnvironment *env, u16 id, v3f pos u16 CraftItem::getDropCount() const { // Special cases - s16 dc = content_craftitem_features(m_content).drop_count; + s16 dc = content_craftitem_features(m_content)->drop_count; if(dc != -1) return dc; // Default @@ -433,7 +431,7 @@ u16 CraftItem::getDropCount() const bool CraftItem::isCookable(CookType type) const { - CraftItemFeatures *f = &content_craftitem_features(m_content); + CraftItemFeatures *f = content_craftitem_features(m_content); if (!f) return false; if (type != f->cook_type && f->cook_type != COOK_ANY) @@ -445,48 +443,48 @@ bool CraftItem::isCookable(CookType type) const InventoryItem *CraftItem::createCookResult() const { - return InventoryItem::create(content_craftitem_features(m_content).cook_result,1,1,0); + return InventoryItem::create(content_craftitem_features(m_content)->cook_result,1,1,0); } bool CraftItem::isFuel() const { - return (content_craftitem_features(m_content).fuel_time != 0.0); + return (content_craftitem_features(m_content)->fuel_time != 0.0); } float CraftItem::getFuelTime() const { - return content_craftitem_features(m_content).fuel_time; + return content_craftitem_features(m_content)->fuel_time; } bool CraftItem::use(ServerEnvironment *env, Player *player) { u16 count = getCount(); bool used = false; - CraftItemFeatures f = content_craftitem_features(m_content); - if (f.consumable) { - if (f.hunger_effect && (f.health_effect < 1 || player->hunger < 100)) { - if (player->hunger + f.hunger_effect > 100) { + CraftItemFeatures *f = content_craftitem_features(m_content); + if (f->consumable) { + if (f->hunger_effect && (f->health_effect < 1 || player->hunger < 100)) { + if (player->hunger + f->hunger_effect > 100) { player->hunger = 100; }else{ - player->hunger += f.hunger_effect; + player->hunger += f->hunger_effect; } used = true; } - if (f.health_effect < 0 || (!used && f.health_effect > 0)) { - player->addHealth(f.health_effect); + if (f->health_effect < 0 || (!used && f->health_effect > 0)) { + player->addHealth(f->health_effect); used = true; } - if (f.cold_effect) { - player->cold_effect = f.cold_effect; + if (f->cold_effect) { + player->cold_effect = f->cold_effect; used = true; } - if (f.energy_effect) { - player->energy_effect = f.energy_effect; + if (f->energy_effect) { + player->energy_effect = f->energy_effect; used = true; } } - if (f.onuse_replace_item != CONTENT_IGNORE) { - m_content = f.onuse_replace_item; + if (f->onuse_replace_item != CONTENT_IGNORE) { + m_content = f->onuse_replace_item; }else if (used) { count--; if (count < 1) @@ -670,7 +668,7 @@ video::ITexture *ClothesItem::getImage() const std::wstring ClothesItem::getGuiText() { std::wstring txt(L" "); - ClothesItemFeatures *f = &content_clothesitem_features(m_content); + ClothesItemFeatures *f = content_clothesitem_features(m_content); txt += f->description; if (f->armour > 0.0 || f->warmth > 0.0 || f->vacuum > 0.0 || f->suffocate > 0.0 || f->durability > 0.0 || f->effect > 1.0) txt += L"\n"; diff --git a/src/inventory.h b/src/inventory.h index 1014d3e..5099b88 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -246,17 +246,10 @@ private: class CraftItem : public InventoryItem { public: - CraftItem(std::string subname, u16 count, u16 data): - InventoryItem(count,data) - { - m_subname = content_craftitem_features(subname).name; - m_content = content_craftitem_features(subname).content; - } CraftItem(content_t content, u16 count, u16 data): InventoryItem(count,data) { - m_subname = content_craftitem_features(content).name; - m_content = content_craftitem_features(content).content; + m_content = content_craftitem_features(content)->content; } /* Implementation interface @@ -308,7 +301,7 @@ public: } u16 freeSpace() const { - if (!content_craftitem_features(m_content).stackable) + if (!content_craftitem_features(m_content)->stackable) return 0; if (m_count > QUANTITY_ITEM_MAX_COUNT) return 0; @@ -325,16 +318,6 @@ public: float getFuelTime() const; bool use(ServerEnvironment *env, Player *player); - - /* - Special methods - */ - std::string getSubName() - { - return m_subname; - } -private: - std::string m_subname; }; class ToolItem : public InventoryItem @@ -439,7 +422,7 @@ public: InventoryItem(1,data) { m_wear = wear; - m_content = content_clothesitem_features(content).content; + m_content = content_clothesitem_features(content)->content; } /* Implementation interface @@ -464,7 +447,7 @@ public: } #ifndef SERVER std::string getBasename() const { - return content_clothesitem_features(m_content).texture; + return content_clothesitem_features(m_content)->texture; } video::ITexture * getImage() const; @@ -479,7 +462,7 @@ public: #endif std::wstring getGuiName() { - return content_clothesitem_features(m_content).description; + return content_clothesitem_features(m_content)->description; } std::wstring getGuiText(); std::string getText() diff --git a/src/list.c b/src/list.c index 4341aee..53f69d2 100644 --- a/src/list.c +++ b/src/list.c @@ -38,6 +38,7 @@ int list_count(void *list) ref_t *l = *((ref_t**)list); while (l) { + c++; l = l->next; } diff --git a/src/mapnode.h b/src/mapnode.h index b4f129b..8b491d0 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -45,7 +45,10 @@ 0x000...0x07f: param2 is fully usable 0x800...0xfff: param2 lower 4 bytes are free */ +#ifndef _HAVE_CONTENT_TYPE +#define _HAVE_CONTENT_TYPE typedef u16 content_t; +#endif #define MAX_CONTENT 0xfff /* diff --git a/src/mineral.cpp b/src/mineral.cpp index 4c5dcbc..fed2d85 100644 --- a/src/mineral.cpp +++ b/src/mineral.cpp @@ -40,7 +40,7 @@ CraftItem *getDiggedMineralItem(u8 mineral, Player *player, InventoryItem *tool) if (m.dug_item == CONTENT_IGNORE) return NULL; - if (content_craftitem_features(m.dug_item).content == CONTENT_IGNORE) + if (content_craftitem_features(m.dug_item)->content == CONTENT_IGNORE) return NULL; if (!tool && m.min_level > 0) diff --git a/src/player.cpp b/src/player.cpp index b7f502c..3d98c94 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -129,6 +129,7 @@ void Player::checkInventory() // this allows only the correct clothing type in a player's // relevant clothing slot { + int i; InventoryList *h = inventory.getList("hat"); InventoryList *j = inventory.getList("jacket"); InventoryList *s = inventory.getList("shirt"); @@ -150,34 +151,30 @@ void Player::checkInventory() p->clearAllowed(); b->setStackable(false); b->clearAllowed(); - for ( - std::map::iterator i = g_content_clothesitem_features.begin(); - i != g_content_clothesitem_features.end(); - i++ - ) { - ClothesItemFeatures c = i->second; - switch (c.type) { + for (i=0; i<4096; i++) { + ClothesItemFeatures *c = content_clothesitem_features(i|CONTENT_CLOTHESITEM_MASK); + switch (c->type) { case CT_HAT: - h->addAllowed(c.content); + h->addAllowed(c->content); break; case CT_JACKET: - j->addAllowed(c.content); + j->addAllowed(c->content); break; case CT_SHIRT: - s->addAllowed(c.content); + s->addAllowed(c->content); break; case CT_DECORATIVE: case CT_MEDALLION: - d->addAllowed(c.content); + d->addAllowed(c->content); break; case CT_BELT: - t->addAllowed(c.content); + t->addAllowed(c->content); break; case CT_PANTS: - p->addAllowed(c.content); + p->addAllowed(c->content); break; case CT_BOOTS: - b->addAllowed(c.content); + b->addAllowed(c->content); break; default:; } @@ -752,7 +749,7 @@ video::ITexture* RemotePlayer::getTexture() InventoryItem *i = l->getItem(0); if (i == NULL) continue; - clothes[j] = content_clothesitem_features(i->getContent()).overlay_texture; + clothes[j] = content_clothesitem_features(i->getContent())->overlay_texture; } std::string tex = ""; @@ -1210,7 +1207,7 @@ video::ITexture* LocalPlayer::getTexture() InventoryItem *i = l->getItem(0); if (i == NULL) continue; - clothes[j] = content_clothesitem_features(i->getContent()).overlay_texture; + clothes[j] = content_clothesitem_features(i->getContent())->overlay_texture; } std::string tex = ""; diff --git a/src/player.h b/src/player.h index ee1b435..364ad2b 100644 --- a/src/player.h +++ b/src/player.h @@ -306,7 +306,7 @@ public: i = l->getItem(0); if (i == NULL) return 0; - return content_clothesitem_features(i->getContent()).armour; + return content_clothesitem_features(i->getContent())->armour; break; case DAMAGE_AIR: l = inventory.getList("hat"); @@ -315,7 +315,7 @@ public: i = l->getItem(0); if (i == NULL) return 0; - return content_clothesitem_features(i->getContent()).suffocate; + return content_clothesitem_features(i->getContent())->suffocate; break; default:; } @@ -362,13 +362,13 @@ public: case DAMAGE_FIRE: case DAMAGE_ATTACK: case DAMAGE_CACTUS: - v += content_clothesitem_features(i->getContent()).armour; + v += content_clothesitem_features(i->getContent())->armour; break; case DAMAGE_COLD: - v += content_clothesitem_features(i->getContent()).warmth; + v += content_clothesitem_features(i->getContent())->warmth; break; case DAMAGE_SPACE: - v += content_clothesitem_features(i->getContent()).vacuum; + v += content_clothesitem_features(i->getContent())->vacuum; break; default:; } diff --git a/src/server.cpp b/src/server.cpp index 3620ed2..5533fdc 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2084,7 +2084,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if (item == NULL) return; - content_t thrown = content_craftitem_features(item->getContent()).thrown_item; + content_t thrown = content_craftitem_features(item->getContent())->thrown_item; // We can throw it, right? if (thrown == CONTENT_IGNORE) { // it may be a tool that throws something else @@ -2097,7 +2097,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if (!item) return; // We can throw it, right? - thrown = content_craftitem_features(item->getContent()).shot_item; + thrown = content_craftitem_features(item->getContent())->shot_item; if (thrown == CONTENT_IGNORE) return; if (g_settings->getBool("tool_wear")) { @@ -2506,7 +2506,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if (wielditem) wieldcontent = wielditem->getContent(); ToolItemFeatures wielded_tool_features = content_toolitem_features(wieldcontent); - CraftItemFeatures wielded_craft_features = content_craftitem_features(wieldcontent); + CraftItemFeatures *wielded_craft_features = content_craftitem_features(wieldcontent); ContentFeatures &wielded_material_features = content_features(wieldcontent); bool selected_node_exists = false; @@ -3953,8 +3953,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) client->SetBlocksNotSent(modified_blocks); } }else if ( - wielded_craft_features.drop_item != CONTENT_IGNORE - && (wielded_craft_features.drop_item&CONTENT_MOB_MASK) != CONTENT_MOB_MASK + wielded_craft_features->drop_item != CONTENT_IGNORE + && (wielded_craft_features->drop_item&CONTENT_MOB_MASK) != CONTENT_MOB_MASK ) { if ((getPlayerPrivs(player) & PRIV_BUILD) == 0) { infostream<<"Not allowing player to drop item: " @@ -3964,7 +3964,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) MapNode n = m_env.getMap().getNodeNoEx(p_over); if (n.getContent() != CONTENT_AIR) return; - n.setContent(content_craftitem_features(item->getContent()).drop_item); + n.setContent(content_craftitem_features(item->getContent())->drop_item); core::list far_players; sendAddNode(p_over, n, 0, &far_players, 30); if (g_settings->getBool("infinite_inventory") == false) { @@ -4015,7 +4015,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) }else if ( ( wielded_tool_features.param_type == CPT_DROP - || wielded_craft_features.param_type == CPT_DROP + || wielded_craft_features->param_type == CPT_DROP ) && wielditem->getData() != 0 ) { @@ -4089,8 +4089,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) SendInventory(peer_id); } } - }else if (wielded_craft_features.teleports > -2) { - s8 dest = wielded_craft_features.teleports; + }else if (wielded_craft_features->teleports > -2) { + s8 dest = wielded_craft_features->teleports; /* If in creative mode, item dropping is disabled unless player has build privileges @@ -4170,8 +4170,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) ServerActiveObject *obj = NULL; /* createSAO will drop all craft items, we may not want that */ if ( - wielded_craft_features.content == wieldcontent - && wielded_craft_features.drop_item == CONTENT_IGNORE + wielded_craft_features->content == wieldcontent + && wielded_craft_features->drop_item == CONTENT_IGNORE ) { InventoryItem *ditem = InventoryItem::create(wieldcontent,item->getDropCount()); obj = ditem->createSAO(&m_env, 0, pos); @@ -4296,7 +4296,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if (l) { ClothesItem *i = (ClothesItem*)l->getItem(0); if (i) { - bonus = content_clothesitem_features(i->getContent()).effect; + bonus = content_clothesitem_features(i->getContent())->effect; } } } @@ -4310,8 +4310,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if (i == NULL) continue; u16 w = wear; - if (content_clothesitem_features(i->getContent()).durability > 1) - w /= content_clothesitem_features(i->getContent()).durability; + if (content_clothesitem_features(i->getContent())->durability > 1) + w /= content_clothesitem_features(i->getContent())->durability; if (w < 15) w = 15; if (bonus > 0.0) {