Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Nanos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ static void nanoEquipHandler(CNSocket* sock, CNPacketData* data) {
resp.iNanoID = nano->iNanoID;
resp.iNanoSlotNum = nano->iNanoSlotNum;

/*
* A gumball (stimpak) buff is keyed to the nano slot, not the nano itself.
* If this slot's occupant is changing, drop the buff so the incoming nano
* doesn't inherit the boost (which would also bypass the gumball type check).
*/
if (plr->equippedNanos[nano->iNanoSlotNum] != nano->iNanoID)
plr->removeBuff(ECSB_STIMPAKSLOT1 + nano->iNanoSlotNum);

// Update player
plr->equippedNanos[nano->iNanoSlotNum] = nano->iNanoID;

Expand All @@ -240,6 +248,9 @@ static void nanoUnEquipHandler(CNSocket* sock, CNPacketData* data) {
if (plr->equippedNanos[nano->iNanoSlotNum] == plr->activeNano)
summonNano(sock, -1);

// a gumball (stimpak) buff is tied to this slot; drop it as the nano leaves
plr->removeBuff(ECSB_STIMPAKSLOT1 + nano->iNanoSlotNum);

// update player
plr->equippedNanos[nano->iNanoSlotNum] = 0;

Expand Down
Loading