aboutsummaryrefslogtreecommitdiff
path: root/src/magic.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-06 19:36:18 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-06 19:36:18 -0300
commit76f6ecb7c809c6e93447efb91bdf50f2a9d50d6b (patch)
treeece58733660361874acc912208d6482d639e556e /src/magic.cc
parent850fa1c0e128a4fe05ffdbdabc9dad25a7530a3f (diff)
downloadgame-76f6ecb7c809c6e93447efb91bdf50f2a9d50d6b.tar.gz
game-76f6ecb7c809c6e93447efb91bdf50f2a9d50d6b.zip
some work on `crmain.cc` and `cract.cc` + merge creature headers
Diffstat (limited to 'src/magic.cc')
-rw-r--r--src/magic.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/magic.cc b/src/magic.cc
index ea1ba73..53ec1da 100644
--- a/src/magic.cc
+++ b/src/magic.cc
@@ -372,8 +372,7 @@ TSummonImpact::TSummonImpact(TCreature *Actor, int Race, int Maximum){
error("TSummonImpact::TSummonImpact: Actor ist NULL.\n");
}
- // TODO(fusion): I think there might be a `IsRaceValid` function that was inlined.
- if(Race < 0 || Race >= NARRAY(RaceData)){
+ if(!IsRaceValid(Race)){
error("TSummonImpact::TSummonImpact: Ungültige Rassennummer %d.\n", Race);
}
@@ -387,7 +386,7 @@ void TSummonImpact::handleField(int x, int y, int z){
int Race = this->Race;
int Maximum = this->Maximum;
if(Actor != NULL
- && Race >= 0 && Race < NARRAY(RaceData)
+ && IsRaceValid(Race)
&& Actor->SummonedCreatures < Maximum){
int x, y, z;
if(SearchSummonField(&x, &y, &z, 2)){
@@ -1870,7 +1869,7 @@ void SummonCreature(TCreature *Actor, int ManaPoints, int Race, bool God){
throw ERROR;
}
- if(Race < 1 || Race >= NARRAY(RaceData)){
+ if(!IsRaceValid(Race)){
error("SummonCreature: Ungültige Rassennummer %d übergeben.\n", Race);
throw ERROR;
}