Skip to content

undoBuy beta ​

Function of @v12-engine/engine

ts
export declare function undoBuy(world: World, entity: Entity, purchaseId?: number): boolean;

Takes a purchase back (ShopSettings.undo): the latest the hero may still undo, or the one named by its id. The item goes (out of its stack, where it went into one), what it cost comes back whole, the parts it used up come back as they were, and the shop has it back in stock. False, and the player told why, where it cannot (undoRefusal)