diff --git a/src/Client/DefScriptInterface.cpp b/src/Client/DefScriptInterface.cpp index 7be5cd9..aa1ed65 100644 --- a/src/Client/DefScriptInterface.cpp +++ b/src/Client/DefScriptInterface.cpp @@ -1215,7 +1215,7 @@ void DefScriptPackage::My_Run(std::string line, std::string username) } - if(scperm > 0) // skip "invisible" scripts (without any permission set) completely. + if(scperm >= 0) // skip "invisible" scripts (without any permission set) completely. { if(usrperm < scperm) { @@ -1227,10 +1227,12 @@ void DefScriptPackage::My_Run(std::string line, std::string username) RunScript("_nopermission",&Set); return; } + else + { + Interpret(curSet); + } } - - Interpret(curSet); } diff --git a/src/Client/PseuWoW.cpp b/src/Client/PseuWoW.cpp index 558806c..ca945a4 100644 --- a/src/Client/PseuWoW.cpp +++ b/src/Client/PseuWoW.cpp @@ -46,8 +46,8 @@ void PseuInstanceRunnable::sleep(uint32 msecs) PseuInstance::PseuInstance(PseuInstanceRunnable *run) { _runnable=run; - _ver="PseuWoW Alpha Build 13.5" DEBUG_APPENDIX; - _ver_short="A13.5" DEBUG_APPENDIX; + _ver="PseuWoW Alpha Build 13.51" DEBUG_APPENDIX; + _ver_short="A13.51" DEBUG_APPENDIX; _wsession=NULL; _rsession=NULL; _scp=NULL; diff --git a/src/Client/World/CMSGConstructor.cpp b/src/Client/World/CMSGConstructor.cpp index 1edc8c3..078d37f 100644 --- a/src/Client/World/CMSGConstructor.cpp +++ b/src/Client/World/CMSGConstructor.cpp @@ -145,7 +145,7 @@ void WorldSession::SendCastSpell(uint32 spellid, bool nocheck) SendWorldPacket(packet); logdetail("Casting spell %u on target "I64FMT,spellid,my->GetTarget()); if(!known) - logcustom(1,RED," - WARNING: spell is NOT known!"); + logcustom(1,LRED," - WARNING: spell is NOT known!"); } void WorldSession::SendWhoListRequest(uint32 minlvl, uint32 maxlvl, uint32 racemask, uint32 classmask, std::string name, std::string guildname, std::vector *zonelist, std::vector *strlist) diff --git a/src/Client/World/ObjMgr.cpp b/src/Client/World/ObjMgr.cpp index 19bd6d3..57b98c0 100644 --- a/src/Client/World/ObjMgr.cpp +++ b/src/Client/World/ObjMgr.cpp @@ -47,6 +47,11 @@ void ObjMgr::Remove(uint64 guid) _obj.erase(guid); // now delete the obj from the mgr delete o; // and delete the obj itself } + else + { + _obj.erase(guid); + logcustom(2,LRED,"ObjMgr::Remove("I64FMT") - not existing",guid); + } } // -- Object part -- diff --git a/src/Client/World/Object.cpp b/src/Client/World/Object.cpp index 2418d94..423d1cd 100644 --- a/src/Client/World/Object.cpp +++ b/src/Client/World/Object.cpp @@ -39,16 +39,15 @@ void Object::Create( uint64 guid ) WorldObject::WorldObject() { - _x = _y = _z = _o = 0; _m = 0; } void WorldObject::SetPosition(float x, float y, float z, float o) { - _x = x; - _y = y; - _z = z; - _o = o; + _wpos.x = x; + _wpos.y = y; + _wpos.z = z; + _wpos.o = o; } void WorldObject::SetPosition(float x, float y, float z, float o, uint16 _map) diff --git a/src/Client/World/Object.h b/src/Client/World/Object.h index 50988e5..1e9cf9b 100644 --- a/src/Client/World/Object.h +++ b/src/Client/World/Object.h @@ -5,6 +5,7 @@ #include "ObjectDefines.h" #include "common.h" #include "HelperDefs.h" +#include "World.h" enum TYPE { @@ -113,10 +114,13 @@ public: virtual ~WorldObject ( ) {} void SetPosition(float x, float y, float z, float o, uint16 _map); void SetPosition(float x, float y, float z, float o); - inline float GetX(void) { return _x; } - inline float GetY(void) { return _y; } - inline float GetZ(void) { return _z; } - inline float GetO(void) { return _o; } + inline void SetPosition(WorldPosition& wp) { _wpos = wp; } + inline void SetPosition(WorldPosition& wp, uint16 mapid) { SetPosition(wp); _m = mapid; } + inline WorldPosition GetPosition(void) {return _wpos; } + inline float GetX(void) { return _wpos.x; } + inline float GetY(void) { return _wpos.y; } + inline float GetZ(void) { return _wpos.z; } + inline float GetO(void) { return _wpos.o; } float GetDistance(WorldObject *obj); float GetDistance2d(float x, float y); float GetDistance(float x, float y, float z); @@ -125,7 +129,7 @@ public: protected: WorldObject(); - float _x,_y,_z,_o; // coords, orientation + WorldPosition _wpos; // coords, orientation uint16 _m; // map }; diff --git a/src/Client/World/Player.cpp b/src/Client/World/Player.cpp index c67674d..da5e0da 100644 --- a/src/Client/World/Player.cpp +++ b/src/Client/World/Player.cpp @@ -56,6 +56,15 @@ void MyCharacter::RemoveSpell(uint32 spellid) } } +bool MyCharacter::HasSpell(uint32 spellid) +{ + for(std::vector::iterator i=_spells.begin(); i != _spells.end(); i++) + if(i->id == spellid) + return true; + return false; +} + + uint16 MyCharacter::GetSpellSlot(uint32 spellid) { for(std::vector::iterator i=_spells.begin(); i != _spells.end(); i++) diff --git a/src/Client/World/Player.h b/src/Client/World/Player.h index 2c6093c..cfd6b25 100644 --- a/src/Client/World/Player.h +++ b/src/Client/World/Player.h @@ -118,26 +118,7 @@ #define TRADE_SLOT_COUNT 7 #define TRADE_SLOT_TRADED_COUNT 6 -#define TRADE_SLOT_NONTRADED 6 - -enum MovementFlags -{ - MOVEMENTFLAG_FORWARD = 0x1, - MOVEMENTFLAG_BACKWARD = 0x2, - MOVEMENTFLAG_STRAFE_LEFT = 0x4, - MOVEMENTFLAG_STRAFE_RIGHT = 0x8, - MOVEMENTFLAG_LEFT = 0x10, - MOVEMENTFLAG_RIGHT = 0x20, - MOVEMENTFLAG_PITCH_UP = 0x40, - MOVEMENTFLAG_PITCH_DOWN = 0x80, - - MOVEMENTFLAG_WALK = 0x100, - MOVEMENTFLAG_JUMPING = 0x2000, - MOVEMENTFLAG_FALLING = 0x4000, - MOVEMENTFLAG_SWIMMING = 0x200000, - MOVEMENTFLAG_ONTRANSPORT = 0x2000000, - MOVEMENTFLAG_SPLINE = 0x4000000 -}; +#define TRADE_SLOT_NONTRADED 6 struct PlayerEnumItem { @@ -208,7 +189,7 @@ public: void ClearSpells(void) { _spells.clear(); } uint64 GetTarget(void) { return _target; } void SetTarget(uint64 guid) { _target = guid; } // should only be called by WorldSession::SendSetSelection() !! - bool HasSpell(uint32 spellid) { return GetSpellSlot(spellid) != 0; } + bool HasSpell(uint32 spellid); uint16 GetSpellSlot(uint32 spellid); private: diff --git a/src/Client/World/UpdateData.cpp b/src/Client/World/UpdateData.cpp index 8198dcc..f58f4bb 100644 --- a/src/Client/World/UpdateData.cpp +++ b/src/Client/World/UpdateData.cpp @@ -333,7 +333,7 @@ void WorldSession::_ValuesUpdate(uint64 uguid, WorldPacket& recvPacket) } else { - logcustom(1,RED,"Got UpdateObject_Values for unknown object "I64FMT,uguid); + logcustom(1,LRED,"Got UpdateObject_Values for unknown object "I64FMT,uguid); tyid = GetTypeIdByGuid(uguid); // can cause problems with TYPEID_CONTAINER!! valuesCount = GetValuesCountByTypeId(tyid); } diff --git a/src/Client/World/WorldSession.cpp b/src/Client/World/WorldSession.cpp index 3b5935d..03aac78 100644 --- a/src/Client/World/WorldSession.cpp +++ b/src/Client/World/WorldSession.cpp @@ -213,6 +213,7 @@ void WorldSession::HandleWorldPacket(WorldPacket *packet) } catch (ByteBufferException bbe) { + logerror("Exception while handling opcode %u [%s]!",packet->GetOpcode(),GetOpcodeName(packet->GetOpcode())); logerror("WorldSession: ByteBufferException"); logerror("ByteBuffer reported: attempt to \"%s\" %u bytes at position %u out of total %u bytes. (wpos=%u)", bbe.action, bbe.readsize, bbe.rpos, bbe.cursize, bbe.wpos); @@ -223,7 +224,7 @@ void WorldSession::HandleWorldPacket(WorldPacket *packet) } catch (...) { - logerror("Exception while handling opcode %u!",packet->GetOpcode()); + logerror("Exception while handling opcode %u [%s]!",packet->GetOpcode(),GetOpcodeName(packet->GetOpcode())); logerror("Data: pktsize=%u, handler=0x%X queuesize=%u",packet->size(),table[hpos].handler,pktQueue.size()); logerror("Packet Hexdump:"); logerror("%s",toHexDump((uint8*)packet->contents(),packet->size(),true).c_str());