From 70ba76034e652709136826beb81abe8de471e9cc Mon Sep 17 00:00:00 2001
From: johns <>
Date: Thu, 1 Aug 2002 19:11:08 +0000
Subject: [PATCH] Check for max mana != 0 for spell casters.

---
 src/unit/unittype.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/unit/unittype.cpp b/src/unit/unittype.cpp
index 94d7edb69..f6384b37d 100644
--- a/src/unit/unittype.cpp
+++ b/src/unit/unittype.cpp
@@ -441,6 +441,13 @@ global void ParsePudUDTA(const char* udta,int length __attribute__((unused)))
 	if( BIT(31,v) )	DebugLevel0("Unused bit 31 used in %d\n" _C_ i);
 #endif
 #undef BIT
+	//
+	//	Unit type checks.
+	//
+	if( unittype->CanCastSpell && !unittype->_MaxMana ) {
+	    DebugLevel0Fn("%s: Need max mana value\n" _C_ unittype->Ident);
+	    unittype->_MaxMana=255;
+	}
     }
 
     // FIXME: peon applies also to peon-with-gold and peon-with-wood
@@ -448,6 +455,7 @@ global void ParsePudUDTA(const char* udta,int length __attribute__((unused)))
 
     DebugLevel0("\tUDTA used %d bytes\n" _C_ udta-start);
 
+
     UpdateStats();
 }