Skip to content

Instantly share code, notes, and snippets.

View rsa's full-sized avatar

Сергей AKA /dev/rsa rsa

  • Murmansk, Russia
View GitHub Profile
@rsa
rsa / gist:665285
Created November 6, 2010 08:46
More ideologic true solve problems in 10677 (especially for VladimirMangos)
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index a47adc3..4768012 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -104,6 +104,10 @@ void Object::_Create(ObjectGuid guid)
void WorldObject::UpdateCall(uint32 newtime, uint32 diff)
{
+ // Initializing m_lastUpdateTime from _this_ thread
+ if (!m_lastUpdateTime)
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index cdd9d9b..305d461 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1822,9 +1822,6 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
pCreature->Summon(spwtype, despwtime);
- if (GetTypeId() == TYPEID_UNIT)
- pCreature->SetCreatorGuid(GetObjectGuid());
@rsa
rsa / gist:706597
Created November 19, 2010 14:46
use UNIT_FIELD_CRITTER for minipets.
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 8d6975b..4c7410d 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -720,7 +720,7 @@ void Pet::Unsummon(PetSaveMode mode, Unit* owner /*= NULL*/)
{
case MINI_PET:
if (p_owner)
- p_owner->_SetMiniPet(NULL);
+ p_owner->SetMiniPet(NULL);
@rsa
rsa / gist:708243
Created November 20, 2010 22:44
Simplify PetActions for use with multiple controlled units. Original author Laise
diff --git a/src/game/Pet.h b/src/game/Pet.h
index 620791d..9cdc2ad 100644
--- a/src/game/Pet.h
+++ b/src/game/Pet.h
@@ -269,4 +269,30 @@ class Pet : public Creature
MANGOS_ASSERT(false);
}
};
+
+struct DoPetActionWithHelper
@rsa
rsa / gist:738244
Created December 12, 2010 19:02
pets 4
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 2de95d6..ab8fda0 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -6214,10 +6214,7 @@ Pet* Unit::GetPet() const
.
Pet* Unit::_GetPet(ObjectGuid guid) const
{
- if (Map* pMap = GetMap())
- return pMap->GetPet(guid);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 4f12275..592743e 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -8871,6 +8871,16 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
{
switch(GetId())
{
+ case 55001:
+ {
@rsa
rsa / gist:757401
Created December 28, 2010 16:42
BASH script to install external ACE
#!/bin/bash
cd /root
wget http://download.dre.vanderbilt.edu/previous_versions/ACE-5.8.3.tar.gz
tar xvfz ACE-5.8.3.tar.gz
cd ACE_wrappers
mkdir objdir
cd objdir
../configure --disable-ace-tests --disable-ace-examples --prefix=/usr/local/
make -j2
@rsa
rsa / gist:896270
Created March 31, 2011 12:22
[PATCH] implement GroupFlagMask and work with his:
From 149d5c772e8f78770bd4d81eaf5004ae5343b965 Mon Sep 17 00:00:00 2001
From: /dev/rsa <kris13@bk.ru>
Date: Thu, 31 Mar 2011 16:04:18 +0400
Subject: [PATCH] implement GroupFlagMask and work with his:
- correct raid group assignment, implement true rules and rights;
- correct displaying assignments in client;
- correct saving assignments to DB;
- remove many old stuff from Group class, remove not needed saving mainTankGuid/mainAssistGuid in DB;
- add role storage for save LFG role in DB;
part of algorithm and group_member structure from TC, realization by me.
@rsa
rsa / gist:1070313
Created July 7, 2011 19:20
attackers patch
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 018c7e9..2052815 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5942,6 +5942,26 @@ bool Unit::IsNeutralToAll() const
return my_faction->IsNeutralToAll();
}
+Unit* Unit::getAttackerForHelper()
+{
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 15f4071..78b48a5 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -285,6 +285,7 @@ bool Map::Add(Player *player)
{
player->GetMapRef().link(this, player);
player->SetMap(this);
+ CreateAttackersStorageFor(player->GetObjectGuid());