Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/ent.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct MapEntities {
// adds an entity to list (puts worldspawn at the beginning)
void add_ent(Ent& addent);
// finds all entities in list matching all stored replaceents and replaces with a withent
void replace_ents(EntList replace_entlist, Ent& withent);
void replace_ents(EntList& replace_entlist, Ent& withent);
// replaces all applicable keyvals on an ent
static void replace_ent(Ent& replaceent, Ent& withent);

Expand Down
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Created By:

#define STRIPPER_QMM_VERSION_MAJOR 2
#define STRIPPER_QMM_VERSION_MINOR 4
#define STRIPPER_QMM_VERSION_REV 2
#define STRIPPER_QMM_VERSION_REV 3

#define STRIPPER_QMM_VERSION STRINGIFY(STRIPPER_QMM_VERSION_MAJOR) "." STRINGIFY(STRIPPER_QMM_VERSION_MINOR) "." STRINGIFY(STRIPPER_QMM_VERSION_REV)

Expand Down
11 changes: 6 additions & 5 deletions src/ent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ void MapEntities::apply_config(std::string file) {
// with mode, don't accept empty entity
else if (mode == mode_with && !ent.keyvals.empty()) {
replace_ents(replace_entlist, ent);
replace_entlist.clear();
}
}
// it's a key/val pair line or something else
Expand Down Expand Up @@ -339,7 +340,7 @@ void MapEntities::add_ent(Ent& addent) {


// finds all entities in list matching all stored replaceents and replaces with a withent
void MapEntities::replace_ents(EntList replace_entlist, Ent& withent) {
void MapEntities::replace_ents(EntList& replace_entlist, Ent& withent) {
// go through all replaceents
for (auto& repent : replace_entlist) {
// find any matching ents in given list
Expand Down Expand Up @@ -378,11 +379,11 @@ TokenList MapEntities::tokenlist_from_entstring(EntString entstring) {
// skip whitespace outside strings
else if (std::isspace(c) && !buildstr)
continue;
// handle opening braces
else if (c == '{')
// handle opening braces outside strings
else if (c == '{' && !buildstr)
tokenlist.push_back("{");
// handle closing braces
else if (c == '}')
// handle closing braces outside strings
else if (c == '}' && !buildstr)
tokenlist.push_back("}");
// handle quote, start of a key or value
else if (c == '"' && !buildstr) {
Expand Down