diff options
| author | Mittendrein Markus <maxmitti@gmx.net> | 2016-05-17 14:10:25 +0200 |
|---|---|---|
| committer | Mittendrein Markus <maxmitti@gmx.net> | 2016-05-17 14:10:25 +0200 |
| commit | 93ddddae60a39f32f33996190be62c700deeb010 (patch) | |
| tree | 7dec1000527377eb630b39fe93069606acbdb85e /System.c4g/DTAutoTreeChop.c | |
| download | ObjectsAppend-93ddddae60a39f32f33996190be62c700deeb010.tar.gz ObjectsAppend-93ddddae60a39f32f33996190be62c700deeb010.zip | |
Initial
Diffstat (limited to 'System.c4g/DTAutoTreeChop.c')
| -rw-r--r-- | System.c4g/DTAutoTreeChop.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/System.c4g/DTAutoTreeChop.c b/System.c4g/DTAutoTreeChop.c new file mode 100644 index 0000000..2e859af --- /dev/null +++ b/System.c4g/DTAutoTreeChop.c @@ -0,0 +1,31 @@ +#strict 2 +#appendto TREE + +static TREE_AutoChop; + +global func NoAutoTreeChop() { return !TREE_AutoChop; } + +func Construction() +{ + if(!NoAutoTreeChop() && FindObject2(Find_AtPoint(), Find_OCF(OCF_Exclusive))) + { + return RemoveObject(); + } + AddEffect("CheckStructure", this, 100, 10, this); + return _inherited(...); +} + +func FxCheckStructureTimer() +{ + if(IsStanding()) + { + if(!(GetOCF() & OCF_Chop) && !NoAutoTreeChop()) + { + ChopDown(); + } + } + else + { + return FX_Execute_Kill; + } +} |
