Skip to content

Commit

Permalink
Merge pull request #647 from jengelh/inventory
Browse files Browse the repository at this point in the history
Resolve crash on inventory pickup
  • Loading branch information
Lgt2x authored Nov 25, 2024
2 parents 1b2f514 + 8e30eea commit f7e6dd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manage/generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1913,8 +1913,11 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE

// copy our values
// memcpy (objinfopointer,&genericpage->objinfo_struct,sizeof(*objinfopointer));
// Description pointer is simply moved
memcpy(objinfopointer, &genericpage->objinfo_struct,
sizeof(*objinfopointer) - sizeof(anim_elem *) - sizeof(otype_wb_info *) - sizeof(t_ai_info *));
genericpage->objinfo_struct.description = nullptr;

strcpy(objinfopointer->name, genericpage->objinfo_struct.name);
if (objinfopointer->anim)
memcpy(objinfopointer->anim, &genericpage->anim, sizeof(genericpage->anim));
Expand Down

0 comments on commit f7e6dd9

Please sign in to comment.