Go to the documentation of this file.
31 memset(&dummy_archetype, 0,
sizeof(
archetype));
42 if (!strncmp(cp,
"Allowed", 7)) {
48 cp = strchr(cp,
' ')+1;
49 while (*(cp+strlen(cp)-1) ==
' ')
50 cp[strlen(cp)-1] =
'\0';
52 if (!strcmp(cp,
"all"))
59 if ((
next = strchr(cp,
',')) != NULL)
62 }
while ((cp =
next) != NULL);
63 }
else if (sscanf(cp,
"chance %d", &
value) && art)
65 else if (sscanf(cp,
"difficulty %d", &
value) && art)
67 else if (!strncmp(cp,
"Object", 6) && art) {
68 art->
item = (
object *)calloc(1,
sizeof(
object));
69 if (art->
item == NULL) {
70 LOG(
llevError,
"init_artifacts: memory allocation failure.\n");
76 LOG(
llevError,
"Init_Artifacts: Could not load object.\n");
86 al->
items.push_back(art);
97 for (
auto art : al->
items) {
virtual bool willLoad(const std::string &filename) override
virtual void load(BufferReader *reader, const std::string &filename) override
size_t bufferreader_current_line(BufferReader *br)
void LOG(LogLevel logLevel, const char *format,...)
std::vector< artifact * > items
artifactlist * get_empty_artifactlist(void)
void object_reset(object *op)
std::vector< sstring > allowed
sstring add_string(const char *str)
virtual void assetDefined(const archetype *asset, const std::string &filename)
artifactlist * first_artifactlist
artifact * get_empty_artifact(void)
artifactlist * find_artifactlist(int type)
static bool endsWith(const char *const str, const char *const with)
AssetsTracker * myTracker
char * bufferreader_next_line(BufferReader *br)
int load_object_from_reader(BufferReader *reader, object *op, int map_flags, bool arch_init, bool artifact_init)