void UDoor::toggle() { const DoorDesc& dd = fast_find_doordesc( objtype_ ); unsigned short oldx = x, oldy = y; set_dirty(); if (is_open()) { if (dd.graphic) graphic = dd.graphic; else graphic = static_cast<u16>(objtype_); x -= dd.xmod; y -= dd.ymod; } else { graphic = dd.open_graphic; x += dd.xmod; y += dd.ymod; } MoveItemWorldPosition( oldx, oldy, this, NULL ); graphic_ext = ctBEu16( graphic ); send_item_to_inrange( this ); }
void UDoor::toggle() { const Items::DoorDesc* dd = static_cast<const Items::DoorDesc*>( &itemdesc( ) ); unsigned short oldx = x, oldy = y; set_dirty(); if ( is_open() ) { if ( dd->graphic ) graphic = dd->graphic; else graphic = static_cast<u16>( objtype_ ); x -= dd->xmod; y -= dd->ymod; } else { graphic = dd->open_graphic; x += dd->xmod; y += dd->ymod; } MoveItemWorldPosition( oldx, oldy, this, NULL ); send_item_to_inrange( this ); }