Skip to content

Commit

Permalink
* Now only update visibility in the battle window when the player him…
Browse files Browse the repository at this point in the history
…self moves, the creature leaves the player's sight, or the creature changes floor.
  • Loading branch information
Nate Fries committed May 18, 2009
1 parent 007e4d7 commit 232eb82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion gm_gameworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ bool GM_Gameworld::specKeyPress (const SDL_keysym& key)
{
// NOTE (nfries88): Not sure whether or not a stackpos is needed.
Position hotkeyPos(0xFFFF, 0, 0);
// FIXME (nfries88): This never gets deleted, but it's a pain to implement.
Item* item = Item::CreateItem(hk.item.itemid, 1);
if(item->isExtendedUseable() && hk.item.useXHairs)
{
Expand Down Expand Up @@ -1190,7 +1191,12 @@ void GM_Gameworld::onCreatureMove(uint32_t id, const Position& oldPos, const Pos
c->startWalk();
c->confirmWalk();

sbvlPanel.winBattle.refreshVisibility();
if((id == GlobalVariables::getPlayerID()) ||
(!Map::getInstance().playerCanSee(newPos.x, newPos.y, newPos.z)) ||
(oldPos.z != newPos.z))
{
sbvlPanel.winBattle.refreshVisibility();
}
}

void GM_Gameworld::onChangeSkills()
Expand Down
4 changes: 2 additions & 2 deletions ui/battlewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ void winBattle_t::clickEntry(glictPos* relmousepos, glictContainer* callerclass)
}
else if(SDL_GetModState() & KMOD_SHIFT)
{
// NOTE (nfries88): no idea how to get a creature's position on the map.
//gw->lookAtCreature(creature->getID());
// NOTE (nfries88): too lazy to implement this...
//gw->lookAtPos(creature->getCurrentPos());
}
else if(creature->getID() != GlobalVariables::getPlayerID())
{
Expand Down

0 comments on commit 232eb82

Please sign in to comment.