[DiscordArchive] wait shouldnt it be against owner not victim ?
[DiscordArchive] wait shouldnt it be against owner not victim ?
Archived author: Rymercyble • Posted: 2022-12-22T00:13:52.498000+00:00
Original source
wait shouldnt it be against owner not victim ?
Archived author: Rymercyble • Posted: 2022-12-22T00:13:58.699000+00:00
Original source
since victim is player
Archived author: Anchy • Posted: 2022-12-22T00:14:22.596000+00:00
Original source
idk i was just copying your code
Archived author: Rymercyble • Posted: 2022-12-22T00:14:33.562000+00:00
Original source
Archived author: Rymercyble • Posted: 2022-12-22T00:15:24.269000+00:00
Original source
now its 1 when i attack with second char
Archived author: Rymercyble • Posted: 2022-12-22T00:15:44.003000+00:00
Original source
that would make sense since i placed hook before not after
Archived author: Rymercyble • Posted: 2022-12-22T00:17:50.593000+00:00
Original source
i moved it to be after so i dont have to add 1 and it works but as we speak earlier now i have to confirm if it counts everything or only players
Archived author: Rymercyble • Posted: 2022-12-22T00:37:56.636000+00:00
Original source
so i confirmed it counts not only players so to count only players i did this
```cpp
int count = 0;
auto threat_list = hostileRef->GetOwner()->GetThreatMgr().GetThreatList();
for (const auto ref: threat_list) {
if (!ref->GetVictim()) {
continue;
}
if (ref->GetVictim()->IsPlayer()) {
count++;
}
}
```
last issue to be solved is that this way it decreases when player dies