@ -302,6 +302,24 @@ void System::collision(GameLevel &level) {
world . send < Events : : GUI > ( Events : : GUI : : COMBAT_START , entity , entity ) ;
world . send < Events : : GUI > ( Events : : GUI : : COMBAT_START , entity , entity ) ;
}
}
} else if ( world . has < InventoryItem > ( entity ) ) {
} else if ( world . has < InventoryItem > ( entity ) ) {
dbc : : log ( " Hit an inventory item, use Sysem::pickup? " ) ;
} else if ( world . has < Device > ( entity ) ) {
System : : device ( world , player . entity , entity ) ;
} else {
dbc : : log ( fmt : : format ( " UNKNOWN COLLISION TYPE {} " , entity ) ) ;
}
}
if ( combat_count = = 0 ) {
// BUG: this is probably how we get stuck in combat
world . send < Events : : GUI > ( Events : : GUI : : NO_NEIGHBORS , player . entity , player . entity ) ;
}
}
void System : : pickup ( GameLevel & level , DinkyECS : : Entity entity ) {
auto & world = * level . world ;
if ( world . has < InventoryItem > ( entity ) ) {
auto item = world . get < InventoryItem > ( entity ) ;
auto item = world . get < InventoryItem > ( entity ) ;
auto & item_pos = world . get < Position > ( entity ) ;
auto & item_pos = world . get < Position > ( entity ) ;
@ -314,19 +332,9 @@ void System::collision(GameLevel &level) {
}
}
}
}
collider . remove ( item_pos . location ) ;
level . collision - > remove ( item_pos . location ) ;
world . remove < Tile > ( entity ) ;
world . remove < Tile > ( entity ) ;
world . send < Events : : GUI > ( Events : : GUI : : LOOT , entity , item ) ;
world . send < Events : : GUI > ( Events : : GUI : : LOOT , entity , item ) ;
} else if ( world . has < Device > ( entity ) ) {
System : : device ( world , player . entity , entity ) ;
} else {
dbc : : log ( fmt : : format ( " UNKNOWN COLLISION TYPE {} " , entity ) ) ;
}
}
if ( combat_count = = 0 ) {
// BUG: this is probably how we get stuck in combat
world . send < Events : : GUI > ( Events : : GUI : : NO_NEIGHBORS , player . entity , player . entity ) ;
}
}
}
}