add radial triggers

This commit is contained in:
MihailRis
2024-07-04 06:09:29 +03:00
parent e6c3775286
commit 736e5b95b6
9 changed files with 117 additions and 44 deletions
+4 -2
View File
@@ -320,10 +320,12 @@ void ContentLoader::loadEntity(EntityDef& def, const std::string& name, const fs
if (auto triggerarr = triggersarr->list(i)) {
auto triggerType = triggerarr->str(0);
if (triggerType == "aabb") {
def.boxTriggers.push_back({
def.boxTriggers.push_back({i, {
{triggerarr->num(1), triggerarr->num(2), triggerarr->num(3)},
{triggerarr->num(4), triggerarr->num(5), triggerarr->num(6)}
});
}});
} else if (triggerType == "radius") {
def.radialTriggers.push_back({i, triggerarr->num(1)});
} else {
logger.error() << name << ": trigger #" << i << " - unknown type "
<< util::quote(triggerType);