Hello

I have been really busy with TruePvE and I am loving it!  Thank you for this awesome mod!

I wanted to block players from destroying Builidings etc during PVE timeslots and figured that I must use the RuleFlags: CupbourdOwnership and AuthorizedDamage.  These for some reason has no affect on items.   none the less... I added a entity group to block damge to builidngs (BuildingBlock as  a EntityGroup) and some other building items like doors and such...   I have not tested them all yet, But it works as expected. 

Problem is that players cannot destroy items placed (i.e. Twig) or pick out unwanted building elements.  But then again that is as expected.   

I went digging into the .cs file and found that the AuthorizedDamage code doesnt seem to make sense, my guess is is that there was a edit made to these ruleflags that was copied and pasted but never altered.  There were 2 instances where the plugin checks for AutorizedDamage and 1 for the cupboard.  Or I am doing something completly wrong. 

I did try and modify these to see if I can get it running but I end up getting errors with hitinfo?.Hitinfo ...  which is probaly due to a syntax error somewhere else.

If there is no solution I will probably end up using the remover tool as noted on some other forum post...  Just a pity that the removal tool ends up being an exploit (i guess unless you start charging them a X (most likely a very large ammount) ammount of scrap to remove a buildingblock).

This is on lines 782 - 786

 // ignore checks if authorized damage enabled (except for players)
            if (ruleSet.HasFlag(RuleFlags.AuthorizedDamage) && !(entity is BasePlayer) && hitinfo.Initiator is BasePlayer && CheckAuthorized(entity, hitinfo.Initiator as BasePlayer, ruleSet))
            {
                if (trace) Trace("Initiator is player with authorization over non-player target; allow and return", 1);
                return true;

This is on lines 874 - 887

  // checks if the player is authorized to damage the entity
        bool CheckAuthorized(BaseEntity entity, BasePlayer player, RuleSet ruleSet)
        {
            // check if the player is the owner of the entity
            if ((!ruleSet.HasFlag(RuleFlags.CupboardOwnership) && player.userID == entity.OwnerID) || entity.OwnerID == 0L)
                return true; // player is the owner or the owner is undefined, allow damage/looting

            // block if building blocked
            if (player.IsBuildingBlocked(entity.transform.position, entity.transform.rotation, entity.bounds))
                return false;

            // if not CupboardOwnership, check for build authorization
            if (!ruleSet.HasFlag(RuleFlags.CupboardOwnership))
                return player.IsBuildingAuthed(entity.transform.position, entity.transform.rotation, entity.bounds);
​


Merged post

Now that I look at it again I dont think there is any mistake (please exuse me if I am being rude in any way)...  I must have applied the rule flags incorrectly or something.