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 / auto_update.sh
Created October 25, 2011 08:18
Auto DB updater script
#!/bin/bash
###############################################################################
# configuration
home="/home/mangos"
mangosConf=$home"/etc/mangosd.conf"
scriptConf=$home"/etc/scriptdev2.conf"
mangosSource=$home"/Mangos-Sources/mangos"
sd2Source=$home"/Mangos-Sources/mangos/src/bindings/scriptdev2"
YTDBSource=$home"/Mangos-Sources/YTDB"
#
@rsa
rsa / compile_r2.sh
Created October 25, 2011 08:16
Auto R2 compiler script
#!/bin/bash
#
#
cd ~/Mangos-Sources/mangos
#patches=`find ./src/bindings/scriptdev2/patches -maxdepth 1 -name "*.patch"`
patches=`find ../patches -maxdepth 1 -name "*.patch"`
for j in $patches; do
@rsa
rsa / core_parser.sh
Created October 25, 2011 08:14
core parser script
#!/bin/bash
logfile=error_gdb.log;
logtime=`date `;
corefiles=`find ~/ -maxdepth 1 -name core*`
for i in $corefiles; do
echo "Crash time: $logtime " >> ~/$logfile
gdb ~/bin/mangos-worldd -c $i -n --batch --command=~/bin/bt.sh >>~/$logfile
rm $i
@rsa
rsa / world_restart.sh
Created October 25, 2011 08:12
Restarter shell script
#!/bin/bash
lockfile="/var/lock/mangos"
if [ -f $lockfile ]; then
rm -f $lockfile
fi
expect ~/bin/mangos_cmd.exp .announce "Server shutdown after operation system request."
sleep 1
expect ~/bin/mangos_cmd.exp .server shutdown "60"
@rsa
rsa / world.sh
Created October 25, 2011 08:11
mangos main shell script
#!/bin/bash
lockfile=/var/lock/mangos
cd ~
while true; do
ulimit -c unlimited
~/bin/core_parser.sh
logger -p user.warn -t mangos "Starting worldd realm 2..."
cat ~/log/worldd.log|grep ERROR >>~/log/error.log
~/bin/mangos-worldd
rm -f ~/worldd.pid
@rsa
rsa / mangos
Created October 25, 2011 08:08
mangos sysV startup script
#! /bin/sh
### BEGIN INIT INFO
# Provides: mangos
# Required-Start: $remote_fs $syslog $named $network $time $mangos $mysql
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts MaNGOS server test realm
diff --git a/src/game/Calendar.h b/src/game/Calendar.h
index 10b75b5..3f3b33b 100644
--- a/src/game/Calendar.h
+++ b/src/game/Calendar.h
@@ -19,8 +19,86 @@
#ifndef MANGOS_CALENDAR_H
#define MANGOS_CALENDAR_H
+#include "Common.h"
+#include "ObjectGuid.h"
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 33b4162..156f7f6 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1061,11 +1061,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
(m_caster->isVisibleForOrDetect(unit, unit, false) && !m_IsTriggeredSpell))
{
if (!unit->isInCombat() && unit->GetTypeId() != TYPEID_PLAYER && ((Creature*)unit)->AI())
- ((Creature*)unit)->AI()->AttackedBy(real_caster);
-
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 374b791..ad1b84e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1129,7 +1129,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
}
}
- if (damagetype != NODAMAGE && pVictim->GetTypeId() == TYPEID_PLAYER)
+ if (damage && damagetype != NODAMAGE && pVictim->GetTypeId() == TYPEID_PLAYER)
@rsa
rsa / gist:1225236
Created September 18, 2011 16:29
lock part 5.4
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 3f5b216..938c803 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -9910,8 +9910,9 @@ void SpellAuraHolder::AddAura(Aura aura, SpellEffectIndex index)
if (Aura* _aura = GetAuraByEffectIndex(index))
{
DEBUG_LOG("SpellAuraHolder::AddAura attempt to add aura (effect %u) to holder of spell %u, but holder already have active aura!", index, GetId());
- RemoveAura(index);
}