Type `BaseCombatEntity' does not contain a definition for `ChangeHealth'Fixed
Edit: the plugin compiles if a few lines are removed, but would be nice if there was a proper fix.

Since the most recent Rust & Oxide update, I'm getting this error when trying to load EditTool:
 Error while compiling: EditTool.cs(1149,32): error CS1061: 
Type `BaseCombatEntity' does not contain a definition for `ChangeHealth' and no extension method `ChangeHealth' 
of type `BaseCombatEntity' could be found. Are you missing an assembly reference?​
same issue

Same issue.

( What lines need to be removed to use the plugin temporarily? )

I did a very ugly fix without any coding skill but now the tool works for me. The "fix" may have some side effects but I haven't noticed anything odd so far. What I did was:

Replace this:
            public void PostSpawn(BaseEntity entity)
            {
                BaseCombatEntity combat = entity as BaseCombatEntity;
                if (combat != null)
                {
                    if (combat.healthFraction < 1f)
                    {
                        combat.ChangeHealth(entity.MaxHealth());
                    }
                }
            }​

with this:
            public void PostSpawn(BaseEntity entity)
            {
                BaseCombatEntity combat = entity as BaseCombatEntity;
            }​


Hopefully we get a proper fix :-)

Jeini
I did a very ugly fix without any coding skill but now the tool works for me. The "fix" may have some side effects but I haven't noticed anything odd so far. What I did was:

Replace this:
            public void PostSpawn(BaseEntity entity)
            {
                BaseCombatEntity combat = entity as BaseCombatEntity;
                if (combat != null)
                {
                    if (combat.healthFraction < 1f)
                    {
                        combat.ChangeHealth(entity.MaxHealth());
                    }
                }
            }​

with this:
            public void PostSpawn(BaseEntity entity)
            {
                BaseCombatEntity combat = entity as BaseCombatEntity;
            }​

Hopefully we get a proper fix :-)

Thanks mate, it worked for me:)

Thank you very much!
The solution is appreciated.
The fix would be changing ChangeHealth to SetHealth, just a simple rename. I'll post an update for it soon.
5e13a8d5b2bc5.jpg Wulf
The fix would be changing ChangeHealth to SetHealth, just a simple rename. I'll post an update for it soon.

Solved! Thank you.

Locked automatically