Skip to content

Commit

Permalink
Gingerbeard Pickup Crash Fix
Browse files Browse the repository at this point in the history
Added Gingerbeard's pick menu crash fix (transhumandesign/kag-base#2145)
  • Loading branch information
mehwaffle10 committed Nov 20, 2024
1 parent 78747e8 commit ff7155c
Show file tree
Hide file tree
Showing 3 changed files with 707 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Base/Entities/Common/Controls/StandardControls.as
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ int zoomLevel = 1; // we can declare a global because this script is just used b
void onInit(CBlob@ this)
{
this.set_s32("tap_time", getGameTime());
CBlob@[] blobs;
this.set("pickup blobs", blobs);
this.set_u16("hover netid", 0);
this.set_bool("release click", false);
this.set_bool("can button tap", true);
this.addCommandID("pickup");
Expand Down Expand Up @@ -73,7 +70,7 @@ void onCommand(CBlob@ this, u8 cmd, CBitStream @params)
if (pickedup is null) return;

if (!pickedup.canBePickedUp(caller)) return;

if (pickedup.isAttached()) return;

// Waffle: Add distance check
Expand All @@ -83,6 +80,7 @@ void onCommand(CBlob@ this, u8 cmd, CBitStream @params)
return;
}

pickedup.setPosition(caller.getPosition());
caller.server_Pickup(pickedup);
}
else if (cmd == this.getCommandID("detach"))
Expand Down
Loading

0 comments on commit ff7155c

Please sign in to comment.