hard to click on enemies
Forum rules
This forum is for feature requests, content changes additions, anything not a Bug in the software.
Please report all bugs on the Support Forums
hard to click on enemies
It?s hard sometimes to click on one enemy to attack it?s happens all the time i click and walk forward and got attacked instead i was suppose to klick on the enemie!
please fix it
please fix it
- ElvenProgrammer
- Founder
- Posts: 2526
- Joined: 13 Apr 2004, 19:11
- Location: Italy
- Contact:
- ElvenProgrammer
- Founder
- Posts: 2526
- Joined: 13 Apr 2004, 19:11
- Location: Italy
- Contact:
Code: Select all
void select_nearest_enemy()
{
// Find monster to attack
std::list<Being*>::iterator i;
int mindist = INT_MAX;
Being *minmonster;
for (i = beings.begin(); i != beings.end(); i++) {
Being *being = (*i);
// Check if is a MONSTER that is alive
int rx, ry;
if ((being->getType() == Being::MONSTER || being->getType() == Being::PLAYER) && ((being->action == Being::STAND) || (being->action == Being::WALK)))
{
int a = (being->x - player_node->x);
int b = (being->y - player_node->y);
int curdist = (a*a + b*b);
if (mindist > curdist && curdist != 0) {
mindist = curdist;
minmonster = being;
//strcat(logstring, tempstring);
//chatWindow->chat_log(logstring, BY_OTHER);
}
}
}
// If Monster found
if (mindist != INT_MAX)
{
//char tempstring[100];
//sprintf(tempstring,"monster found: (%d|%d)", minmonster->x, minmonster->y);
//chatWindow->chat_log(tempstring, BY_OTHER);
autoTarget = minmonster;
}
}
OK I modified it that one version only targets monsters and the other
one should target players. But it doesn't work....
Note: your version only works for standing/walking players and monsters.
Sitting Players can't be targeted.
that:
if ((being->getType() == Being::PLAYER) && ((being->action == Being::STAND) || (being->action == Being::WALK)))
always targets myself...
one should target players. But it doesn't work....
Note: your version only works for standing/walking players and monsters.
Sitting Players can't be targeted.
that:
if ((being->getType() == Being::PLAYER) && ((being->action == Being::STAND) || (being->action == Being::WALK)))
always targets myself...