60 TurretConfig - Failed to compile: TurretConfig.cs(477,64): error CS1061: Type `HeldEntity' does not contain a definition for `primaryMagazine' and no extension method `primaryMagazine' of type `HeldEntity' could be found. Are you missing an assembly reference? Type `HeldEntity' does not contain a definition for `primaryMagazine'Solved
TurretConfig - Failed to compile: TurretConfig.cs(477,64): error CS1061: Type `HeldEntity' does not contain a definition for `primaryMagazine' and no extension method `primaryMagazine' of type `HeldEntity' could be found. Are you missing an assembly reference?
Wulf
If the configuration file isn't created, the plugin is not loaded. Check your oxide/logs for errors.
I searched through the errors and this popped up, do you by chance know how to fix it?
Error while compiling: TurretConfig.cs(477,64): error CS1061: Type `HeldEntity' does not contain a definition for `primaryMagazine' and no extension method `primaryMagazine' of type `HeldEntity' could be found. Are you missing an assembly reference? In layman's terms, find the instances of "AttachedWeapon" in TurretConfig.cs, and change them to "GetAttachedWeapon()". There should be 2 cases where this occurs, both within the "CheckAutoTurretAmmo" method, at lines 467 and 474.
The resulting method should look like this:
private void CheckAutoTurretAmmo(AutoTurret turret)
{
if (!_infiniteAmmo) return;
if (!permission.UserHasPermission(turret.OwnerID.ToString(), "turretconfig.infiniteammo")) return;
var items = new List<Item>();
var projectile = turret.GetAttachedWeapon().primaryMagazine.ammoType.GetComponent<ItemModProjectile>();
turret.inventory.FindAmmo(items, projectile.ammoType);
var total = items.Sum(x => x.amount);
if (total < 1)
{
turret.inventory.AddItem(turret.GetAttachedWeapon().primaryMagazine.ammoType, 1);
}
} Works with this Change
stgerbeThanks
Works with this Change
Yes it works for me too, just wishing for a fix for infinite ammo ,
Error while compiling: TurretConfig.cs(477,64): error CS1061: Type `HeldEntity' does not contain a definition for `primaryMagazine' and no extension method `primaryMagazine' of type `HeldEntity' could be found. Are you missing an assembly reference? lordzilei am getting the same error. how about wolf get on the moder instead of us that found the fix and have the moder fix the mod???
I think you will have to be patient, I am still waiting for a 2+ years "fix" for proximity alert, The only reply i get is that as this is a community forum for free plugins there are "no guarantees" .
I am also hoping for a "infinite" ammo fix for this plugin too.
(17:51:20) | Unable to load TurretConfig. TurretConfig.cs(477,64): error CS1061: Type `HeldEntity' does not contain a definition for `primaryMagazine' and no extension method `primaryMagazine' of type `HeldEntity' could be found. Are you missing an assembly reference?
(17:51:20) | No previous version to rollback plugin: TurretConfig
- 1
- 2