Jump to content

Identifier Not Found


Recommended Posts

Posted

In SpellEffects.cpp I'm trying to edit the line:

    AreaTableEntry const* targetAreaEntry = GetAreaEntryByAreaID(target->GetZoneId());
   if(targetAreaEntry && (targetAreaEntry->flags & AREA_FLAG_CAPITAL ))
   {
       SendCastResult(SPELL_FAILED_NO_DUELING);            // Dueling isn't allowed here
       return;
   }

and change that line to:

if(targetAreaEntry && (targetAreaEntry->flags & AREA_FLAG_CAPITAL || (GetAreaId() == 2317) || (GetZoneId() == 3817)) )

So that those areas will basically have disabled dueling. Now, the C++ might be wrong, I've tried a few other ways, I'm very new with all this stuff anyway, but I always get the error:

..\\..\\src\\game\\SpellEffects.cpp(4972) : error C3861: 'GetAreaId': identifier not found

..\\..\\src\\game\\SpellEffects.cpp(4972) : error C3861: 'GetZoneId': identifier not found

So I thought I needed to include some resource file, so I tried stuff like including Map.h, MapManager.h, etc, etc and none of them get rid of this error. So I have a feeling I'm doing something completely wrong :S.

Posted

if(targetAreaEntry && ((targetAreaEntry->flags & AREA_FLAG_CAPITAL) || GetAreaId() == 2317 || GetZoneId() == 3817))

You were trying to do bitwise AND with all those getarea/getzone.

edit: err, I mislooked, you weren't, but this way is more clear

Posted

=/ got this back:

..\\..\\src\\game\\SpellEffects.cpp(4925) : error C2065: 'targetAreaEntry' : undeclared identifier
..\\..\\src\\game\\SpellEffects.cpp(4925) : error C2227: left of '->flags' must point to class/struct/union/generic type
       type is ''unknown-type''
..\\..\\src\\game\\SpellEffects.cpp(4925) : error C3861: 'GetAreaId': identifier not found
..\\..\\src\\game\\SpellEffects.cpp(4925) : error C3861: 'GetZoneId': identifier not found

Posted

Those other errors we me being stupid and putting it in the line above it that looked very similar.

The target->GetZoneId() worked perfectly! These zones now give the "Dueling is not allowed here error." Nice!

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use