Beispiel #1
0
void Start::addItemToPlace(Coord c, Zone* z, Item item) {
    z->getLocationAt(c)->addItem(item);
    ItemType* itemType = item.getType();
    int light = itemType->getStatValue(Stat::LIGHT);
    if (light > 0) {
        myFovCirclePerm(z, c, light, 1);
        if (z == player->getZone()) {
            playerFieldOfView(false);
        }
    }
}
Beispiel #2
0
Item Start::removeItemFromPlace(Coord c, Zone* z, int index) {
    Item item = z->getLocationAt(c)->removeItem(index);
    ItemType* itemType = item.getType();
    int light = itemType->getStatValue(Stat::LIGHT);
    if (light > 0) {
        myFovCirclePerm(z, c, light, -1);
        if (z == player->getZone()) {
            playerFieldOfView(false);
        }
    }
    return item;
}