Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] Still got magic numbers but is this going to be an issue in spell script to check quest objective da

[DiscordArchive] Still got magic numbers but is this going to be an issue in spell script to check quest objective da

[DiscordArchive] Still got magic numbers but is this going to be an issue in spell script to check quest objective da

Pages (3): 1 2 3 Next
rektbyfaith
Administrator
0
01-14-2024, 10:29 PM
#1
Archived author: Malcrom • Posted: 2024-01-14T22:29:44.945000+00:00
Original source

Still got magic numbers but is this going to be an issue in spell script to check quest objective data?
[Image: image.png?ex=690c7898&is=690b2718&hm=762...4dbbfa964&]
rektbyfaith
01-14-2024, 10:29 PM #1

Archived author: Malcrom • Posted: 2024-01-14T22:29:44.945000+00:00
Original source

Still got magic numbers but is this going to be an issue in spell script to check quest objective data?
[Image: image.png?ex=690c7898&is=690b2718&hm=762...4dbbfa964&]

rektbyfaith
Administrator
0
01-14-2024, 10:34 PM
#2
Archived author: Northstrider • Posted: 2024-01-14T22:34:59.179000+00:00
Original source

you have to check GetCaster() before casting it to player
rektbyfaith
01-14-2024, 10:34 PM #2

Archived author: Northstrider • Posted: 2024-01-14T22:34:59.179000+00:00
Original source

you have to check GetCaster() before casting it to player

rektbyfaith
Administrator
0
01-14-2024, 10:35 PM
#3
Archived author: Malcrom • Posted: 2024-01-14T22:35:49.199000+00:00
Original source

i did
rektbyfaith
01-14-2024, 10:35 PM #3

Archived author: Malcrom • Posted: 2024-01-14T22:35:49.199000+00:00
Original source

i did

rektbyfaith
Administrator
0
01-14-2024, 10:36 PM
#4
Archived author: Northstrider • Posted: 2024-01-14T22:36:26.360000+00:00
Original source

you did GetCaster()->ToPlayer(); this can crash if GetCaster() returns nullptr
rektbyfaith
01-14-2024, 10:36 PM #4

Archived author: Northstrider • Posted: 2024-01-14T22:36:26.360000+00:00
Original source

you did GetCaster()->ToPlayer(); this can crash if GetCaster() returns nullptr

rektbyfaith
Administrator
0
01-14-2024, 10:36 PM
#5
Archived author: Malcrom • Posted: 2024-01-14T22:36:36.744000+00:00
Original source

if (!player || !target)
return;
rektbyfaith
01-14-2024, 10:36 PM #5

Archived author: Malcrom • Posted: 2024-01-14T22:36:36.744000+00:00
Original source

if (!player || !target)
return;

rektbyfaith
Administrator
0
01-14-2024, 10:36 PM
#6
Archived author: Northstrider • Posted: 2024-01-14T22:36:41.667000+00:00
Original source

read above
rektbyfaith
01-14-2024, 10:36 PM #6

Archived author: Northstrider • Posted: 2024-01-14T22:36:41.667000+00:00
Original source

read above

rektbyfaith
Administrator
0
01-14-2024, 10:37 PM
#7
Archived author: Fabian • Posted: 2024-01-14T22:37:02.704000+00:00
Original source

he wants you to do a !caster
rektbyfaith
01-14-2024, 10:37 PM #7

Archived author: Fabian • Posted: 2024-01-14T22:37:02.704000+00:00
Original source

he wants you to do a !caster

rektbyfaith
Administrator
0
01-14-2024, 10:37 PM
#8
Archived author: Northstrider • Posted: 2024-01-14T22:37:16.710000+00:00
Original source

If you wanna go this route you can also do Object::ToPlayer(GetCaster())
rektbyfaith
01-14-2024, 10:37 PM #8

Archived author: Northstrider • Posted: 2024-01-14T22:37:16.710000+00:00
Original source

If you wanna go this route you can also do Object::ToPlayer(GetCaster())

rektbyfaith
Administrator
0
01-14-2024, 10:37 PM
#9
Archived author: Malcrom • Posted: 2024-01-14T22:37:52.737000+00:00
Original source

```cpp
Player* player = GetCaster()->ToPlayer();
Creature* target = GetTarget()->ToCreature();
if (!player || !target)
return;
```
rektbyfaith
01-14-2024, 10:37 PM #9

Archived author: Malcrom • Posted: 2024-01-14T22:37:52.737000+00:00
Original source

```cpp
Player* player = GetCaster()->ToPlayer();
Creature* target = GetTarget()->ToCreature();
if (!player || !target)
return;
```

rektbyfaith
Administrator
0
01-14-2024, 10:37 PM
#10
Archived author: Malcrom • Posted: 2024-01-14T22:37:58.876000+00:00
Original source

so thats not safe?
rektbyfaith
01-14-2024, 10:37 PM #10

Archived author: Malcrom • Posted: 2024-01-14T22:37:58.876000+00:00
Original source

so thats not safe?

Pages (3): 1 2 3 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)