struct npc_data *nd;
nd = (TBL_NPC*)bl;
if (nd->vd->class_!=45) // looks like a warp then it's a warp even if it's not type warp. Some warps are NPCTYPE_SCRIPT instead!
if (nd->subtype != NPCTYPE_WARP)
return 0; //Not a warp
for a while it worked fine but now I found a warp that causes a crash : the "vd" on it is NULL.
Edit : nevermind, it seems preventing the null pointer crash by adding "if ((nd->vd)" worked. I guess vd does get filled with data eventually, just not immediately, so the warp does get detected properly.
Maybe not. It seems entirely random whether vd has data or not. Sometimes the code detects the warp, other times it doesn't until sometime happens, like another character passes through it. Maybe I need to call some function here to ensure vd has data in it?
Question
Seravy
I'm currently using
struct npc_data *nd; nd = (TBL_NPC*)bl; if (nd->vd->class_!=45) // looks like a warp then it's a warp even if it's not type warp. Some warps are NPCTYPE_SCRIPT instead! if (nd->subtype != NPCTYPE_WARP) return 0; //Not a warp
for a while it worked fine but now I found a warp that causes a crash : the "vd" on it is NULL.
Edit : nevermind, it seems preventing the null pointer crash by adding "if ((nd->vd)" worked. I guess vd does get filled with data eventually, just not immediately, so the warp does get detected properly.Maybe not. It seems entirely random whether vd has data or not. Sometimes the code detects the warp, other times it doesn't until sometime happens, like another character passes through it. Maybe I need to call some function here to ensure vd has data in it?
Edited by SeravyLink to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.