Closed jakwings closed 5 years ago
I feel bad for the unchecked memory allocation everywhere, just hope the NULL is never spawned. :( I always mix up C and C++, new
and new(std::nothrow)
. :P
I decided to resolve the conflict due to #543 using github's resolve feature. @iology can you please check it is resolved correctly?
No, git showed a confusing diff:
--- a/Main/Source/nonhuman.cpp
+++ b/Main/Source/nonhuman.cpp
@@ -959,7 +959,7 @@ truth vampirebat::SpecialBiteEffect(character* Victim, v2 HitPos, int BodyPartIn
return false;
}
-bool ChamaleonPolymorphRandomly(chameleon* c){
+bool ChameleonPolymorphRandomly(chameleon* c){
if(!c->StateIsActivated(POLYMORPH_LOCK)){
character* NewForm = c->PolymorphRandomly(100, 1000, 500 + RAND() % 500);
if(NewForm==NULL)ABORT("chameleon PolymorphRandomly failed"); //means needs more checks
The actual function name is still ChamaleonPolymorphRandomly.
This may prevent some memory corruption. Also added more checks for NULL pointers.