@@ -25,7 +25,7 @@ namespace Content.Server.Dice
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<DiceComponent, ComponentInit>(OnComponentInit);
|
SubscribeLocalEvent<DiceComponent, ComponentInit>(OnComponentInit);
|
||||||
SubscribeLocalEvent<DiceComponent, ActivateInWorldEvent>(OnActivate);
|
SubscribeLocalEvent<DiceComponent, UseInHandEvent>(OnUseInHand);
|
||||||
SubscribeLocalEvent<DiceComponent, LandEvent>(OnLand);
|
SubscribeLocalEvent<DiceComponent, LandEvent>(OnLand);
|
||||||
SubscribeLocalEvent<DiceComponent, ExaminedEvent>(OnExamined);
|
SubscribeLocalEvent<DiceComponent, ExaminedEvent>(OnExamined);
|
||||||
}
|
}
|
||||||
@@ -36,8 +36,11 @@ namespace Content.Server.Dice
|
|||||||
component.CurrentSide = component.Sides;
|
component.CurrentSide = component.Sides;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnActivate(EntityUid uid, DiceComponent component, ActivateInWorldEvent args)
|
private void OnUseInHand(EntityUid uid, DiceComponent component, UseInHandEvent args)
|
||||||
{
|
{
|
||||||
|
if (args.Handled) return;
|
||||||
|
|
||||||
|
args.Handled = true;
|
||||||
Roll(uid, component);
|
Roll(uid, component);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user