Notice the !, which means 'not'.
GameManager.LocalPlayer.IsInCombat = true if you are in combat, false if you are not in combat.
!GameManager.LocalPlayer.IsInCombat = false if you are in combat, true if you are not in combat.
Code:
// Your suggested implementation.
if (!GameManager.CanVacuum)
CommonBehaviors.VacuumLoot();
// will vacuum loot any time it's unable to vacuum loot. Not very effective.
Code:
// Without the NOT
if (GameManager.CanVacuum)
CommonBehaviors.VacuumLoot();
// will vacuum loot any time it can vacuum loot, including in combat.
Code:
// Without the NOT AND with a NOT in combat.
if (GameManager.CanVacuum && !GameManager.LocalPlayer.IsInCombat)
CommonBehaviors.VacuumLoot();
// will vacuum loot any time it can vacuum loot, and only if it's NOT in combat.
as for 'return' keywords, they are used to pass a variable back up one level, or to break out of a void method. Since the plugin Pulse() is a void method itself, any 'return;' used will simply stop execution of the method at that point, and return to the pulsator to move onto the next pulse.
It's good for things like:
Code:
if (GameManager.Me.IsInCombat)
return;
Because it'll effectively stop the plugin from acting any time it's in combat, as it'll be returned through that block of code.
Placing a return keyword before the 'execute command' which I assume you mean as 'VacuumLoot() would simply and effectively stop it from vacuum looting in all cases.