eventDialogPending wasnt being properly initialized which caused a bug where your first NPC click would be registered from unintended ranges, incidentally it also opened your inventory which was kind of amusing.