Skip to content

Commit 51e15d5

Browse files
committed
Add CanPickupEntity to RFTimedExplosive
ICanPickupEntity adjusted to BaseEntity to support new hook call
1 parent 895a00b commit 51e15d5

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

resources/Rust.opj

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21689,6 +21689,31 @@
2168921689
"MSILHash": "WV+au3i32a6i9ipirJZF0HDBg87L58lyQf6qygcrges=",
2169021690
"HookCategory": "Primitive"
2169121691
}
21692+
},
21693+
{
21694+
"Type": "Simple",
21695+
"Hook": {
21696+
"InjectionIndex": 0,
21697+
"ReturnBehavior": 4,
21698+
"ArgumentBehavior": 4,
21699+
"ArgumentString": "a0.player,this",
21700+
"HookTypeName": "Simple",
21701+
"Name": "ICanPickupEntity [RFTimedExplosive]",
21702+
"HookName": "ICanPickupEntity",
21703+
"AssemblyName": "Assembly-CSharp.dll",
21704+
"TypeName": "RFTimedExplosive",
21705+
"Flagged": false,
21706+
"Signature": {
21707+
"Exposure": 2,
21708+
"Name": "Pickup",
21709+
"ReturnType": "System.Void",
21710+
"Parameters": [
21711+
"BaseEntity/RPCMessage"
21712+
]
21713+
},
21714+
"MSILHash": "wqlaAG3eSQyXIKpW2QgqrfE5zGZ16N125WeWRT3zBDs=",
21715+
"HookCategory": "Player"
21716+
}
2169221717
}
2169321718
],
2169421719
"Modifiers": [

src/RustHooks.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ private object IOnLoseCondition(Item item, float amount)
146146
#region Player Hooks
147147

148148
/// <summary>
149-
/// Called when a player attempts to pickup a DoorCloser entity
149+
/// Called when a player attempts to pick up a DoorCloser or RFTimedExplosive entity
150150
/// </summary>
151151
/// <param name="basePlayer"></param>
152152
/// <param name="entity"></param>
153153
/// <returns></returns>
154154
[HookMethod("ICanPickupEntity")]
155-
private object ICanPickupEntity(BasePlayer basePlayer, DoorCloser entity)
155+
private object ICanPickupEntity(BasePlayer basePlayer, BaseEntity entity)
156156
{
157157
object callHook = Interface.CallHook("CanPickupEntity", basePlayer, entity);
158158
return callHook is bool result && !result ? (object)true : null;

0 commit comments

Comments
 (0)