Prevent rare bug where a remote player will grab a non-grabbable object momentarily

This commit is contained in:
MysterD 2020-10-04 23:06:52 -07:00
parent 5eb5e678c5
commit e9761cd3e6
1 changed files with 2 additions and 0 deletions

View File

@ -303,6 +303,8 @@ void mario_stop_riding_object(struct MarioState *m) {
void mario_grab_used_object(struct MarioState *m) {
if (m->usedObj == NULL || m->usedObj->oHeldState == HELD_HELD) { return; }
if (m->heldObj == NULL && m->usedObj != NULL) {
// prevent grabbing a non-grabbable object
if (!(m->usedObj->oInteractType & INTERACT_GRABBABLE)) { return; }
m->heldObj = m->usedObj;
m->heldObj->heldByPlayerIndex = m->playerIndex;
obj_set_held_state(m->heldObj, bhvCarrySomething3);