Jake Rich submitted a new resource:
Anti Foundation Stacking - Prevents players from stacking foundations
Read more about this resource...
Anti Foundation Stacking [Obsolete]
Discussion in 'Plugin Support' started by Jake Rich, Nov 7, 2016.
-
Jake Rich updated Anti Foundation Stacking with a new update entry:
0.1.0
-
Cool plugin. Just a opinion however, maybe remove a few brackets here and there to make it a tad bit cleaner?
Code:void OnEntityBuilt(Planner plan, GameObject go){ BaseEntity entity = go.ToBaseEntity(); if (entity == null) return; if (!foundationWidth.ContainsKey(entity.ShortPrefabName)) return; double localEntityWidth = foundationWidth[entity.ShortPrefabName]; List<BaseEntity> list = new List<BaseEntity>(); Vis.Entities(entity.transform.position, 3f, list, copyLayer, QueryTriggerInteraction.Ignore); foreach (BaseEntity targetEntity in list){ if (targetEntity == entity || !foundationWidth.ContainsKey(targetEntity.ShortPrefabName)) continue; float localDistance = Vector3.Distance(targetEntity.CenterPoint(),entity.CenterPoint()); double targetEntityWidth = foundationWidth[targetEntity.ShortPrefabName]; if (localDistance + 0.05d < localEntityWidth + targetEntityWidth) //Accounts for floating point errors{ entity.Kill(); if (plan.GetOwnerPlayer() != null) PrintToChat(plan.GetOwnerPlayer(), lang.GetMessage("BlockMessage",this)); return; } }
)
[DOUBLEPOST=1478557250][/DOUBLEPOST]Im mainly pointing out the if statements by the way:
Code:if (targetEntity == entity || !foundationWidth.ContainsKey(targetEntity.ShortPrefabName)) { continue; }
Code:if (targetEntity == entity || !foundationWidth.ContainsKey(targetEntity.ShortPrefabName)) continue;
-
Updater plugin requires a ResourceId variable added to the source code to verify the version of a plugin now. Your ResourceId is "2207".
I've gone ahead and added your ResourceId to your latest version as an example.Attached Files:
-
-
So, is the purpose of this to also prevent wall stacking/double walls, or solely foundation placement?
-
-
Installed it because I wanted to prevent players from using this but
http://puu.sh/savDW/9882e1e287.jpg -
-
nice plugin but as MimiV posted , that is the real problem in this game still .
-