Commit 7c8b0bdc authored by Jesse B's avatar Jesse B

Update MQ2Melee.cpp

Change as per EQMule convo in discord. 


Chatwiththisname - Today at 11:32 PM
static inline PSPAWNINFO SpawnMe() {
    return GetCharInfo()->pSpawn;
}
I think that's the reference that @Kaen01 was looking for.
eqmule - Today at 11:33 PM
dont do that if getcharinfo is NULL u will crash

Line 1449 to 1451 MQ2Melee.cpp
how would you do it to avoid crash?


eqmule - Today at 11:37 PM
so:

static inline PSPAWNINFO SpawnMe() {
   if(pCharSpawn) {
           return (PSPAWNINFO)pCharSpawn;
   }
   return NULL;
}
parent 45f40c37
......@@ -1447,7 +1447,10 @@ static inline int SpawnType(PSPAWNINFO x, unsigned long mask) {
}
static inline PSPAWNINFO SpawnMe() {
return GetCharInfo()->pSpawn;
if(pCharSpawn) {
return (PSPAWNINFO)pCharSpawn;
}
return NULL;
}
static inline PSPAWNINFO SpawnMount() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment