Server-side GlobalVerbs now work when used (#455)
This commit is contained in:
committed by
Pieter-Jan Briers
parent
d5a9747712
commit
0cf34d2d26
@@ -112,6 +112,27 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var globalVerb in VerbUtility.GetGlobalVerbs(Assembly.GetExecutingAssembly()))
|
||||
{
|
||||
if (globalVerb.GetType().ToString() != use.VerbKey)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (globalVerb.RequireInteractionRange)
|
||||
{
|
||||
var distanceSquared = (userEntity.Transform.WorldPosition - entity.Transform.WorldPosition)
|
||||
.LengthSquared;
|
||||
if (distanceSquared > VerbUtility.InteractionRangeSquared)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
globalVerb.Activate(userEntity, entity);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user