I didn’t do anything to trigger it. I just hit an enemy with the t5 hammer. The weapon was not cursed. This is most certainly a game breaking bug.
Edit: this is Experienced Pixel Dungeon
Not really a big fan of rogue likes but I’ll give it shot, being free and all.