What's new

Skrypty & Kody Kompilacja

Status
Not open for further replies.

DiS

Advanced User
Joined
Apr 5, 2008
Messages
274
Reaction score
12
Witam! Od d?u?szego czasu bezskutecznie pr?buje skompilowa? czyste source silnika avesta sql.
Kompilacja dochodzi praktycznie do ko?ca, ju? przy 'linkowaniu' wywala mi b??dy z kt?rych nic nie wiem :/
Plik exe silnika zostaje stworzony i co dziwne odpala, lecz po odpaleniu sypie miliony b??d?w wszystkiego, lecz odpala i da si? zalogowac na serva. Co to za czary? xd
Kolejna rzecz co mnie bardzo dziwi to oryginalny plik exe zajmuje ~1.5 mb
Natomiast ten co mi wyszed? z tymi b?edami zajmuje ~3.5mb


U?ywam takich parametr?w:

Compile c++
-D__PROTOCOL_76__
-D__WINDOWS__
-D__USE_MYSQL__
-D__USE_OTPCH__


Linker
-march
-lboost_regex
-lboost_system
-lboost_thread
-lws2_32
-llua5.1
-lmysql
-llibxml2
-lwsock32
-lgmp




B??dy jak wida? ni?ej s? od includowania w plikach: otpch.h i definitions.h
no ale source mam czyste i nic nie zmieniane..



Compiler: Default compiler
Building Makefile: "C:\Users\pc\Desktop\REV\Makefile.win"
Executing make...
make.exe -f "C:\Users\pc\Desktop\REV\Makefile.win" all
g++.exe -c src_rev102/account.cpp -o src_rev102/account.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/account.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/account.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/actions.cpp -o src_rev102/actions.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/actions.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/actions.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/allocator.cpp -o src_rev102/allocator.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/allocator.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/allocator.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/ban.cpp -o src_rev102/ban.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/ban.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/ban.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/baseevents.cpp -o src_rev102/baseevents.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/baseevents.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/baseevents.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/beds.cpp -o src_rev102/beds.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/beds.cpp:21:

src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/beds.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/chat.cpp -o src_rev102/chat.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/chat.cpp:20:

src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/chat.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/combat.cpp -o src_rev102/combat.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/combat.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/combat.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file
src_rev102/combat.cpp: In static member function `static void Combat::getCombatArea(const Position&, const Position&, const AreaCombat*, std::list<Tile*, std::allocator<Tile*> >&)':
src_rev102/combat.cpp:140: warning: comparison is always true due to limited range of data type
src_rev102/combat.cpp:140: warning: comparison is always true due to limited range of data type
src_rev102/combat.cpp:140: warning: comparison is always true due to limited range of data type

src_rev102/combat.cpp:141: warning: comparison is always true due to limited range of data type
src_rev102/combat.cpp:141: warning: comparison is always true due to limited range of data type

src_rev102/combat.cpp: In member function `bool AreaCombat::getList(const Position&, const Position&, std::list<Tile*, std::allocator<Tile*> >&) const':
src_rev102/combat.cpp:1158: warning: comparison is always true due to limited range of data type
src_rev102/combat.cpp:1158: warning: comparison is always true due to limited range of data type
src_rev102/combat.cpp:1158: warning: comparison is always true due to limited range of data type

src_rev102/combat.cpp:1159: warning: comparison is always true due to limited range of data type
src_rev102/combat.cpp:1159: warning: comparison is always true due to limited range of data type

g++.exe -c src_rev102/commands.cpp -o src_rev102/commands.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/commands.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/commands.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file
In file included from src_rev102/commands.cpp:47:
src_rev102/globalevent.h:99:7: warning: no newline at end of file

g++.exe -c src_rev102/condition.cpp -o src_rev102/condition.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/condition.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/condition.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/configmanager.cpp -o src_rev102/configmanager.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/configmanager.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/configmanager.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/connection.cpp -o src_rev102/connection.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/connection.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/connection.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/container.cpp -o src_rev102/container.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/container.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/container.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/creature.cpp -o src_rev102/creature.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/creature.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/creature.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/creatureevent.cpp -o src_rev102/creatureevent.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/creatureevent.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/creatureevent.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/cylinder.cpp -o src_rev102/cylinder.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/cylinder.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/cylinder.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/database.cpp -o src_rev102/database.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/database.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/database.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/databasemysql.cpp -o src_rev102/databasemysql.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/databasemysql.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/databasemysql.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/databasesqlite.cpp -o src_rev102/databasesqlite.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/databasesqlite.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,

from src_rev102/databasesqlite.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/depot.cpp -o src_rev102/depot.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/depot.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/depot.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/exception.cpp -o src_rev102/exception.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/exception.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/exception.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/fileloader.cpp -o src_rev102/fileloader.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/fileloader.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/fileloader.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/game.cpp -o src_rev102/game.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/game.cpp:21:

src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/game.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file
In file included from src_rev102/game.cpp:47:
src_rev102/globalevent.h:99:7: warning: no newline at end of file

g++.exe -c src_rev102/globalevent.cpp -o src_rev102/globalevent.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/globalevent.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,

from src_rev102/otpch.h:9,
from src_rev102/globalevent.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

In file included from src_rev102/globalevent.cpp:22:
src_rev102/globalevent.h:99:7: warning: no newline at end of file

g++.exe -c src_rev102/house.cpp -o src_rev102/house.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/house.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/house.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/housetile.cpp -o src_rev102/housetile.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/housetile.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/housetile.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/ioaccount.cpp -o src_rev102/ioaccount.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/ioaccount.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/ioaccount.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/iomapotbm.cpp -o src_rev102/iomapotbm.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/iomapotbm.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/iomapotbm.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/iomapserialize.cpp -o src_rev102/iomapserialize.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/iomapserialize.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,

from src_rev102/iomapserialize.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/iomapxml.cpp -o src_rev102/iomapxml.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/iomapxml.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/iomapxml.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/ioplayer.cpp -o src_rev102/ioplayer.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/ioplayer.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/ioplayer.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/item.cpp -o src_rev102/item.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/item.cpp:21:

src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/item.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/items.cpp -o src_rev102/items.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/items.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/items.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/logger.cpp -o src_rev102/logger.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/logger.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/logger.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/luascript.cpp -o src_rev102/luascript.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/luascript.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/luascript.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/mailbox.cpp -o src_rev102/mailbox.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/mailbox.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/mailbox.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/map.cpp -o src_rev102/map.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/map.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/map.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/md5.cpp -o src_rev102/md5.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/md5.cpp:1:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/md5.cpp:1:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/monster.cpp -o src_rev102/monster.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/monster.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/monster.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/monsters.cpp -o src_rev102/monsters.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/monsters.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/monsters.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/movement.cpp -o src_rev102/movement.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/movement.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/movement.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/networkmessage.cpp -o src_rev102/networkmessage.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/networkmessage.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,

from src_rev102/networkmessage.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/npc.cpp -o src_rev102/npc.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/npc.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/npc.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/otpch.cpp -o src_rev102/otpch.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/otpch.cpp:1:

src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/otpch.cpp:1:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/otserv.cpp -o src_rev102/otserv.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/otserv.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/otserv.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/outfit.cpp -o src_rev102/outfit.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/outfit.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/outfit.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file
src_rev102/outfit.cpp:186:2: warning: no newline at end of file

g++.exe -c src_rev102/outputmessage.cpp -o src_rev102/outputmessage.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/outputmessage.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/outputmessage.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/party.cpp -o src_rev102/party.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/party.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/party.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/player.cpp -o src_rev102/player.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/player.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/player.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/position.cpp -o src_rev102/position.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/position.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/position.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/protocol.cpp -o src_rev102/protocol.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/protocol.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/protocol.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/protocolgame.cpp -o src_rev102/protocolgame.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/protocolgame.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/protocolgame.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/protocollogin.cpp -o src_rev102/protocollogin.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/protocollogin.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/protocollogin.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/raids.cpp -o src_rev102/raids.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/raids.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/raids.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/rsa.cpp -o src_rev102/rsa.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/rsa.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/rsa.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/scheduler.cpp -o src_rev102/scheduler.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/scheduler.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/scheduler.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/scriptmanager.cpp -o src_rev102/scriptmanager.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/scriptmanager.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/scriptmanager.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file
In file included from src_rev102/scriptmanager.cpp:32:
src_rev102/globalevent.h:99:7: warning: no newline at end of file

g++.exe -c src_rev102/server.cpp -o src_rev102/server.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/server.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/server.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/sha1.cpp -o src_rev102/sha1.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/sha1.cpp:40:

src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/sha1.cpp:40:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/spawn.cpp -o src_rev102/spawn.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/spawn.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/spawn.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/spells.cpp -o src_rev102/spells.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/spells.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/spells.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/status.cpp -o src_rev102/status.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/status.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/status.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/talkaction.cpp -o src_rev102/talkaction.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/talkaction.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/talkaction.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/tasks.cpp -o src_rev102/tasks.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/tasks.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/tasks.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/teleport.cpp -o src_rev102/teleport.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/teleport.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/teleport.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/thing.cpp -o src_rev102/thing.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/thing.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/thing.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/tile.cpp -o src_rev102/tile.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/tile.cpp:22:

src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/tile.cpp:22:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/tools.cpp -o src_rev102/tools.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/tools.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/tools.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/trashholder.cpp -o src_rev102/trashholder.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/trashholder.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,

from src_rev102/otpch.h:9,
from src_rev102/trashholder.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/vocation.cpp -o src_rev102/vocation.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/vocation.cpp:21:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/vocation.cpp:21:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/waitlist.cpp -o src_rev102/waitlist.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/waitlist.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/waitlist.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

g++.exe -c src_rev102/weapons.cpp -o src_rev102/weapons.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

In file included from src_rev102/definitions.h:68,
from src_rev102/otpch.h:9,
from src_rev102/weapons.cpp:20:
src_rev102/compiler/gcc.h:81:27: warning: no newline at end of file
In file included from src_rev102/definitions.h:82,
from src_rev102/otpch.h:9,
from src_rev102/weapons.cpp:20:
src_rev102/compiler/workarounds.h:78:35: warning: no newline at end of file

windres.exe -i Project1_private.rc --input-format=rc -o Project1_private.res -O coff

g++.exe src_rev102/account.o src_rev102/actions.o src_rev102/allocator.o src_rev102/ban.o src_rev102/baseevents.o src_rev102/beds.o src_rev102/chat.o src_rev102/combat.o src_rev102/commands.o src_rev102/condition.o src_rev102/configmanager.o src_rev102/connection.o src_rev102/container.o src_rev102/creature.o src_rev102/creatureevent.o src_rev102/cylinder.o src_rev102/database.o src_rev102/databasemysql.o src_rev102/databasesqlite.o src_rev102/depot.o src_rev102/exception.o src_rev102/fileloader.o src_rev102/game.o src_rev102/globalevent.o src_rev102/house.o src_rev102/housetile.o src_rev102/ioaccount.o src_rev102/iomapotbm.o src_rev102/iomapserialize.o src_rev102/iomapxml.o src_rev102/ioplayer.o src_rev102/item.o src_rev102/items.o src_rev102/logger.o src_rev102/luascript.o src_rev102/mailbox.o src_rev102/map.o src_rev102/md5.o src_rev102/monster.o src_rev102/monsters.o src_rev102/movement.o src_rev102/networkmessage.o src_rev102/npc.o src_rev102/otpch.o src_rev102/otserv.o src_rev102/outfit.o src_rev102/outputmessage.o src_rev102/party.o src_rev102/player.o src_rev102/position.o src_rev102/protocol.o src_rev102/protocolgame.o src_rev102/protocollogin.o src_rev102/raids.o src_rev102/rsa.o src_rev102/scheduler.o src_rev102/scriptmanager.o src_rev102/server.o src_rev102/sha1.o src_rev102/spawn.o src_rev102/spells.o src_rev102/status.o src_rev102/talkaction.o src_rev102/tasks.o src_rev102/teleport.o src_rev102/thing.o src_rev102/tile.o src_rev102/tools.o src_rev102/trashholder.o src_rev102/vocation.o src_rev102/waitlist.o src_rev102/weapons.o Project1_private.res -o "Project1.exe" -L"lib" -march -lboost_regex -lboost_system -lboost_thread -lws2_32 -llua5.1 -lmysql -llibxml2 -lwsock32 -lgmp

Execution terminated
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Kompilacja

Mo?e brakuje jednego entera na ko?cu pliku? Bo w tego typu plikach powinna (?) by? jedna pusta linijka na ko?cu.
 

DiS

Advanced User
Joined
Apr 5, 2008
Messages
274
Reaction score
12
Odp: Kompilacja

No dodalem w plikach o ktorych pisalo enter na koncu i teraz inny blad z pliku combat.cpp: cos nie tak z ta funkcja..
Ja nie wiem czy brakuje mi jakis bibliotek czy co, ludzie pisali ze kompilowalo im sie to source.
Mo?e ma kto? jaki? pomys??

LOG:
Compiler: Default compiler
Building Makefile: "C:\Users\pc\Desktop\test\Makefile.win"
Executing make...
make.exe -f "C:\Users\pc\Desktop\test\Makefile.win" all
g++.exe -c src/account.cpp -o src/account.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/actions.cpp -o src/actions.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/allocator.cpp -o src/allocator.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/ban.cpp -o src/ban.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/baseevents.cpp -o src/baseevents.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/beds.cpp -o src/beds.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/chat.cpp -o src/chat.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/combat.cpp -o src/combat.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

src/combat.cpp: In static member function `static void Combat::getCombatArea(const Position&, const Position&, const AreaCombat*, std::list<Tile*, std::allocator<Tile*> >&)':

src/combat.cpp:140: warning: comparison is always true due to limited range of data type
src/combat.cpp:140: warning: comparison is always true due to limited range of data type
src/combat.cpp:140: warning: comparison is always true due to limited range of data type
src/combat.cpp:141: warning: comparison is always true due to limited range of data type
src/combat.cpp:141: warning: comparison is always true due to limited range of data type

src/combat.cpp: In member function `bool AreaCombat::getList(const Position&, const Position&, std::list<Tile*, std::allocator<Tile*> >&) const':
src/combat.cpp:1158: warning: comparison is always true due to limited range of data type

src/combat.cpp:1158: warning: comparison is always true due to limited range of data type
src/combat.cpp:1158: warning: comparison is always true due to limited range of data type
src/combat.cpp:1159: warning: comparison is always true due to limited range of data type
src/combat.cpp:1159: warning: comparison is always true due to limited range of data type

g++.exe -c src/commands.cpp -o src/commands.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/condition.cpp -o src/condition.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/configmanager.cpp -o src/configmanager.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/connection.cpp -o src/connection.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/container.cpp -o src/container.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/creature.cpp -o src/creature.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/creatureevent.cpp -o src/creatureevent.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/cylinder.cpp -o src/cylinder.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/database.cpp -o src/database.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/databasemysql.cpp -o src/databasemysql.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/databasesqlite.cpp -o src/databasesqlite.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/depot.cpp -o src/depot.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/exception.cpp -o src/exception.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/fileloader.cpp -o src/fileloader.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/game.cpp -o src/game.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/globalevent.cpp -o src/globalevent.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/house.cpp -o src/house.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/housetile.cpp -o src/housetile.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/ioaccount.cpp -o src/ioaccount.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/iomapotbm.cpp -o src/iomapotbm.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/iomapserialize.cpp -o src/iomapserialize.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/iomapxml.cpp -o src/iomapxml.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/ioplayer.cpp -o src/ioplayer.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/item.cpp -o src/item.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/items.cpp -o src/items.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/logger.cpp -o src/logger.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/luascript.cpp -o src/luascript.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/mailbox.cpp -o src/mailbox.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/map.cpp -o src/map.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/md5.cpp -o src/md5.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/monster.cpp -o src/monster.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/monsters.cpp -o src/monsters.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/movement.cpp -o src/movement.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/networkmessage.cpp -o src/networkmessage.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/npc.cpp -o src/npc.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/otpch.cpp -o src/otpch.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/otserv.cpp -o src/otserv.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/outfit.cpp -o src/outfit.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/outputmessage.cpp -o src/outputmessage.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/party.cpp -o src/party.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/player.cpp -o src/player.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/position.cpp -o src/position.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/protocol.cpp -o src/protocol.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/protocolgame.cpp -o src/protocolgame.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/protocollogin.cpp -o src/protocollogin.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/raids.cpp -o src/raids.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/rsa.cpp -o src/rsa.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/scheduler.cpp -o src/scheduler.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/scriptmanager.cpp -o src/scriptmanager.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/server.cpp -o src/server.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/sha1.cpp -o src/sha1.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/spawn.cpp -o src/spawn.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/spells.cpp -o src/spells.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/status.cpp -o src/status.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/talkaction.cpp -o src/talkaction.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/tasks.cpp -o src/tasks.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/teleport.cpp -o src/teleport.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/thing.cpp -o src/thing.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/tile.cpp -o src/tile.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/tools.cpp -o src/tools.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/trashholder.cpp -o src/trashholder.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/vocation.cpp -o src/vocation.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/waitlist.cpp -o src/waitlist.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

g++.exe -c src/weapons.cpp -o src/weapons.o -I"include" -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_MYSQL__ -D__USE_OTPCH__ -fexpensive-optimizations -O1

windres.exe -i Project1_private.rc --input-format=rc -o Project1_private.res -O coff

g++.exe src/account.o src/actions.o src/allocator.o src/ban.o src/baseevents.o src/beds.o src/chat.o src/combat.o src/commands.o src/condition.o src/configmanager.o src/connection.o src/container.o src/creature.o src/creatureevent.o src/cylinder.o src/database.o src/databasemysql.o src/databasesqlite.o src/depot.o src/exception.o src/fileloader.o src/game.o src/globalevent.o src/house.o src/housetile.o src/ioaccount.o src/iomapotbm.o src/iomapserialize.o src/iomapxml.o src/ioplayer.o src/item.o src/items.o src/logger.o src/luascript.o src/mailbox.o src/map.o src/md5.o src/monster.o src/monsters.o src/movement.o src/networkmessage.o src/npc.o src/otpch.o src/otserv.o src/outfit.o src/outputmessage.o src/party.o src/player.o src/position.o src/protocol.o src/protocolgame.o src/protocollogin.o src/raids.o src/rsa.o src/scheduler.o src/scriptmanager.o src/server.o src/sha1.o src/spawn.o src/spells.o src/status.o src/talkaction.o src/tasks.o src/teleport.o src/thing.o src/tile.o src/tools.o src/trashholder.o src/vocation.o src/waitlist.o src/weapons.o Project1_private.res -o "Project1.exe" -L"lib" -march -s -Os -lboost_regex -lboost_system -lboost_thread -lws2_32 -llua5.1 -lmysql -llibxml2 -lwsock32 -lgmp

Execution terminated


a tutaj te linijki

In static member function `static void Combat::getCombatArea(const Position&, const Position&, const AreaCombat*, std::list<Tile*, std::allocator<Tile*> >&)':

oraz

C:\Users\pc\Desktop\test\src\combat.cpp In member function `bool AreaCombat::getList(const Position&, const Position&, std::list<Tile*, std::allocator<Tile*> >&) const':



A TUTAJ CALY PLIK COMBAT.CPP
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"

#include "combat.h"

#include "configmanager.h"
#include "game.h"
#include "creature.h"
#include "player.h"
#include "const.h"
#include "tools.h"
#include "weapons.h"
#include "spells.h"

#include <sstream>

extern Game g_game;
extern Weapons* g_weapons;
extern ConfigManager g_config;
extern Spells* g_spells;

Combat::Combat()
{
params.condition = NULL;
params.valueCallback = NULL;
params.tileCallback = NULL;
params.targetCallback = NULL;
area = NULL;

formulaType = FORMULA_UNDEFINED;
mina = 0.0;
minb = 0.0;
maxa = 0.0;
maxb = 0.0;
}

Combat::~Combat()
{
delete params.condition;
delete params.valueCallback;
delete params.tileCallback;
delete params.targetCallback;
delete area;
}

bool Combat::getMinMaxValues(Creature* creature, Creature* target, int32_t& min, int32_t& max) const
{
if(!creature){
return false;
}

if(creature->getCombatValues(min, max)){
return true;
}
else if(Player* player = creature->getPlayer()){
if(params.valueCallback){
params.valueCallback->getMinMaxValues(player, min, max, params.useCharges);
return true;
}
else{
switch(formulaType){
case FORMULA_LEVELMAGIC:
{
max = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * mina + minb);
min = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * maxa + maxb);
return true;
}

case FORMULA_SKILL:
{
Item* tool = player->getWeapon();
const Weapon* weapon = g_weapons->getWeapon(tool);

min = (int32_t)minb;

if(weapon){
max = (int32_t)(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb);
if(params.useCharges && tool->hasCharges() && g_config.getBoolean(ConfigManager::REMOVE_WEAPON_CHARGES)){
int32_t newCharge = std::max((int32_t)0, ((int32_t)tool->getCharges()) - 1);
g_game.transformItem(tool, tool->getID(), newCharge);
}
}
else{
max = (int32_t)maxb;
}

return true;
}

case FORMULA_VALUE:
{
min = (int32_t)mina;
max = (int32_t)maxa;

return true;
}

default:
min = 0;
max = 0;
return false;
}

//std::cout << "No callback set for combat" << std::endl;
}
}
else if(formulaType == FORMULA_VALUE){
min = (int32_t)mina;
max = (int32_t)maxa;
return true;
}

return false;
}

void Combat::getCombatArea(const Position& centerPos, const Position& targetPos, const AreaCombat* area,
std::list<Tile*>& list)
{
if(area){
area->getList(centerPos, targetPos, list);
}
else if(targetPos.x >= 0 && targetPos.y >= 0 && targetPos.z >= 0 &&
targetPos.x <= 0xFFFF && targetPos.y <= 0xFFFF && targetPos.z < MAP_MAX_LAYERS)
{
Tile* tile = g_game.getTile(targetPos.x, targetPos.y, targetPos.z);
if(!tile) {
tile = new Tile(targetPos.x, targetPos.y, targetPos.z);
g_game.setTile(tile);
}

list.push_back(tile);
}
}

CombatType_t Combat::ConditionToDamageType(ConditionType_t type)
{
switch(type){
case CONDITION_FIRE:
return COMBAT_FIREDAMAGE;
break;

case CONDITION_ENERGY:
return COMBAT_ENERGYDAMAGE;
break;

case CONDITION_POISON:
return COMBAT_POISONDAMAGE;
break;

default:
break;
}

return COMBAT_NONE;
}

ConditionType_t Combat::DamageToConditionType(CombatType_t type)
{
switch(type){
case COMBAT_FIREDAMAGE: return CONDITION_FIRE;
case COMBAT_ENERGYDAMAGE: return CONDITION_ENERGY;
case COMBAT_POISONDAMAGE: return CONDITION_POISON;
default: break;
}

return CONDITION_NONE;
}

bool Combat::isPlayerCombat(const Creature* target)
{
if(target->getPlayer()){
return true;
}

if(target->isSummon() && target->getMaster()->getPlayer()){
return true;
}

return false;
}

ReturnValue Combat::canTargetCreature(const Player* player, const Creature* target)
{
if(player == target){
return RET_YOUMAYNOTATTACKTHISPLAYER;
}

if(!player->hasFlag(PlayerFlag_IgnoreProtectionZone)){
//pz-zone
if(player->getZone() == ZONE_PROTECTION){
return RET_YOUMAYNOTATTACKAPERSONWHILEINPROTECTIONZONE;
}
if(target->getZone() == ZONE_PROTECTION){
return RET_YOUMAYNOTATTACKAPERSONINPROTECTIONZONE;
}

//nopvp-zone
if(isPlayerCombat(target)){
if(player->getZone() == ZONE_NOPVP){
return RET_ACTIONNOTPERMITTEDINANOPVPZONE;
}
if(target->getZone() == ZONE_NOPVP){
return RET_YOUMAYNOTATTACKAPERSONINPROTECTIONZONE;
}
}
}

if(player->hasFlag(PlayerFlag_CannotUseCombat) || !target->isAttackable()){
if(target->getPlayer()){
return RET_YOUMAYNOTATTACKTHISPLAYER;
}
else{
return RET_YOUMAYNOTATTACKTHISCREATURE;
}
}

if (g_config.getBoolean(ConfigManager::TEAM_MODE)) {
const Player* targetPlayer = target->getPlayer();
if (player && targetPlayer &&
player->getGuildId() == targetPlayer->getGuildId())
{
return RET_YOUMAYNOTATTACKTHISPLAYER;
}
}

#ifdef __SKULLSYSTEM__
if(player->hasSafeMode() && target->getPlayer()) {
if(player->getParty()) {
if(player->getParty()->isPlayerMember(target->getPlayer()) ||
player->getParty()->getLeader() == target)
{
return Combat::canDoCombat(player, target);
}
}
if(target->getPlayer()->getSkull() == SKULL_NONE) {
if(!Combat::isInPvpZone(player, target)) {
return RET_TURNSECUREMODETOATTACKUNMARKEDPLAYERS;
}
}
}
#endif

return Combat::canDoCombat(player, target);
}

ReturnValue Combat::canDoCombat(const Creature* caster, const Tile* tile, bool isAggressive)
{
if(tile->hasProperty(BLOCKPROJECTILE)){
return RET_NOTENOUGHROOM;
}

//if(!tile->ground){
// return RET_NOTPOSSIBLE;
//}

if(tile->floorChange()){
return RET_NOTENOUGHROOM;
}

if(tile->getTeleportItem()){
return RET_NOTENOUGHROOM;
}

if(caster){
if(caster->getPosition().z < tile->getPosition().z){
return RET_FIRSTGODOWNSTAIRS;
}

if(caster->getPosition().z > tile->getPosition().z){
return RET_FIRSTGOUPSTAIRS;
}

if(const Player* player = caster->getPlayer()){
if(player->hasFlag(PlayerFlag_IgnoreProtectionZone)){
return RET_NOERROR;
}
}
}

//pz-zone
if(isAggressive && tile->hasFlag(TILESTATE_PROTECTIONZONE)){
return RET_ACTIONNOTPERMITTEDINPROTECTIONZONE;
}

return RET_NOERROR;
}

bool Combat::isInPvpZone(const Creature* attacker, const Creature* target)
{
if(attacker->getZone() != ZONE_PVP){
return false;
}

if(target->getZone() != ZONE_PVP){
return false;
}

return true;
}

ReturnValue Combat::canDoCombat(const Creature* attacker, const Creature* target)
{
if(attacker){
if(const Player* targetPlayer = target->getPlayer()){
if(targetPlayer->hasFlag(PlayerFlag_CannotBeAttacked)){
return RET_YOUMAYNOTATTACKTHISPLAYER;
}

if(const Player* attackerPlayer = attacker->getPlayer()){
if(attackerPlayer->hasFlag(PlayerFlag_CannotAttackPlayer)){
return RET_YOUMAYNOTATTACKTHISPLAYER;
}
}

if(attacker->isSummon()){
if(const Player* masterAttackerPlayer = attacker->getMaster()->getPlayer()){
if(masterAttackerPlayer->hasFlag(PlayerFlag_CannotAttackPlayer)){
return RET_YOUMAYNOTATTACKTHISPLAYER;
}
}
}
}
else if(target->getMonster()){
if(const Player* attackerPlayer = attacker->getPlayer()){
if(attackerPlayer->hasFlag(PlayerFlag_CannotAttackMonster)){
return RET_YOUMAYNOTATTACKTHISCREATURE;
}
}
}

if(attacker->getPlayer() || (attacker->isSummon() && attacker->getMaster()->getPlayer()) ){
//nopvp-zone
if(target->getPlayer() && target->getTile()->hasFlag(TILESTATE_NOPVPZONE)){
return RET_ACTIONNOTPERMITTEDINANOPVPZONE;
}

if(g_game.getWorldType() == WORLD_TYPE_NO_PVP){
if(target->getPlayer()){
if(!isInPvpZone(attacker, target)){
return RET_YOUMAYNOTATTACKTHISPLAYER;
}
}

if(target->isSummon() && target->getMaster()->getPlayer()){
if(!isInPvpZone(attacker, target)){
return RET_YOUMAYNOTATTACKTHISCREATURE;
}
}
}
}
}

return RET_NOERROR;
}

void Combat::setPlayerCombatValues(formulaType_t _type, double _mina, double _minb, double _maxa, double _maxb)
{
formulaType = _type;
mina = _mina;
minb = _minb;
maxa = _maxa;
maxb = _maxb;
}

bool Combat::setParam(CombatParam_t param, uint32_t value)
{
switch(param){
case COMBATPARAM_COMBATTYPE:
{
params.combatType = (CombatType_t)value;
return true;
}

case COMBATPARAM_EFFECT:
{
params.impactEffect = (uint8_t)value;
return true;
}

case COMBATPARAM_DISTANCEEFFECT:
{
params.distanceEffect = (uint8_t)value;
return true;
}

case COMBATPARAM_BLOCKEDBYARMOR:
{
params.blockedByArmor = (value != 0);
return true;
}

case COMBATPARAM_BLOCKEDBYSHIELD:
{
params.blockedByShield = (value != 0);
return true;
}

case COMBATPARAM_TARGETCASTERORTOPMOST:
{
params.targetCasterOrTopMost = (value != 0);
return true;
}

case COMBATPARAM_CREATEITEM:
{
params.itemId = value;
return true;
}

case COMBATPARAM_AGGRESSIVE:
{
params.isAggressive = (value != 0);
return true;
}

case COMBATPARAM_DISPEL:
{
params.dispelType = (ConditionType_t)value;
return true;
}

case COMBATPARAM_USECHARGES:
{
params.useCharges = (value != 0);
return true;
}

case COMBATPARAM_HITEFFECT:
{
params.hitEffect = (MagicEffectClasses)value;
return true;
}

case COMBATPARAM_HITTEXTCOLOR:
{
params.hitTextColor = (TextColor_t)value;
return true;
}

default:
{
break;
}
}

return false;
}

bool Combat::setCallback(CallBackParam_t key)
{
switch(key){
case CALLBACKPARAM_LEVELMAGICVALUE:
{
delete params.valueCallback;
params.valueCallback = new ValueCallback(FORMULA_LEVELMAGIC);
return true;
}

case CALLBACKPARAM_SKILLVALUE:
{
delete params.valueCallback;
params.valueCallback = new ValueCallback(FORMULA_SKILL);
return true;
}

case CALLBACKPARAM_TARGETTILECALLBACK:
{
delete params.tileCallback;
params.tileCallback = new TileCallback();
break;
}

case CALLBACKPARAM_TARGETCREATURECALLBACK:
{
delete params.targetCallback;
params.targetCallback = new TargetCallback();
break;
}

default:
{
std::cout << "Combat::setCallback - Unknown callback type: " << (uint32_t)key << std::endl;
break;
}
}

return false;
}

CallBack* Combat::getCallback(CallBackParam_t key)
{
switch(key){
case CALLBACKPARAM_LEVELMAGICVALUE:
case CALLBACKPARAM_SKILLVALUE:
{
return params.valueCallback;
}

case CALLBACKPARAM_TARGETTILECALLBACK:
{
return params.tileCallback;
}

case CALLBACKPARAM_TARGETCREATURECALLBACK:
{
return params.targetCallback;
}
}

return NULL;
}

bool Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, void* data)
{
Combat2Var* var = (Combat2Var*)data;
int32_t healthChange = random_range(var->minChange, var->maxChange, DISTRO_NORMAL);

if(g_game.combatBlockHit(params.combatType, caster, target, healthChange, params.blockedByShield, params.blockedByArmor)){
return false;
}

if(healthChange < 0){
if (caster && target) {
Player* casterPlayer = caster->getPlayer();
Player* targetPlayer = target->getPlayer();
if (casterPlayer && targetPlayer) {
healthChange = healthChange / 2;

if (g_config.getBoolean(ConfigManager::TEAM_MODE) &&
casterPlayer->getGuildId() == targetPlayer->getGuildId())
{
int damagePercent = g_config.getNumber(ConfigManager::DAMAGE_PERCENT);
healthChange = (healthChange * damagePercent) / 100;
}
}
}
}

bool result = g_game.combatChangeHealth(params.combatType, params.hitEffect, params.hitTextColor, caster, target, healthChange);

if(result){
CombatConditionFunc(caster, target, params, NULL);
CombatDispelFunc(caster, target, params, NULL);
}

return result;
}

bool Combat::CombatManaFunc(Creature* caster, Creature* target, const CombatParams& params, void* data)
{
Combat2Var* var = (Combat2Var*)data;
int32_t manaChange = random_range(var->minChange, var->maxChange, DISTRO_NORMAL);

if(manaChange < 0){
if (caster && target) {
Player* casterPlayer = caster->getPlayer();
Player* targetPlayer = target->getPlayer();
if (casterPlayer && targetPlayer) {
manaChange = manaChange / 2;

if (g_config.getBoolean(ConfigManager::TEAM_MODE) &&
casterPlayer->getGuildId() == targetPlayer->getGuildId())
{
int damagePercent = g_config.getNumber(ConfigManager::DAMAGE_PERCENT);
manaChange = (manaChange * damagePercent) / 100;
}
}
}
}

bool result = g_game.combatChangeMana(caster, target, manaChange);

if(result){
CombatConditionFunc(caster, target, params, NULL);
CombatDispelFunc(caster, target, params, NULL);
}

return result;
}

bool Combat::CombatConditionFunc(Creature* caster, Creature* target, const CombatParams& params, void* data)
{
bool result = false;

if(params.condition){
if(caster == target || !target->isImmune(params.condition->getType())){
Condition* conditionCopy = params.condition->clone();
if(caster){
conditionCopy->setParam(CONDITIONPARAM_OWNER, caster->getID());
}

//TODO: infight condition until all aggressive conditions has ended
result = target->addCombatCondition(conditionCopy);
}
}

return result;
}

bool Combat::CombatDispelFunc(Creature* caster, Creature* target, const CombatParams& params, void* data)
{
if(target->hasCondition(params.dispelType)){
target->removeCondition(caster, params.dispelType);
return true;
}

return false;
}

bool Combat::CombatNullFunc(Creature* caster, Creature* target, const CombatParams& params, void* data)
{
CombatConditionFunc(caster, target, params, NULL);
CombatDispelFunc(caster, target, params, NULL);
return true;
}

void Combat::combatTileEffects(const SpectatorVec& list, Creature* caster, Tile* tile, const CombatParams& params)
{
if(params.itemId != 0){
uint32_t itemId = params.itemId;
Player* p_caster = NULL;
if(caster){
if(caster->getPlayer()){
p_caster = caster->getPlayer();
}
else if(caster->isSummon()){
p_caster = caster->getMaster()->getPlayer();
}
}
if(p_caster){
if(g_game.getWorldType() == WORLD_TYPE_NO_PVP || tile->hasFlag(TILESTATE_NOPVPZONE)){
if(itemId == ITEM_FIREFIELD_PVP){
itemId = ITEM_FIREFIELD_NOPVP;
}
else if(itemId == ITEM_POISONFIELD_PVP){
itemId = ITEM_POISONFIELD_NOPVP;
}
else if(itemId == ITEM_ENERGYFIELD_PVP){
itemId = ITEM_ENERGYFIELD_NOPVP;
}
}
else if(params.isAggressive){
const ItemType& it = Item::items[itemId];
if(!it.blockSolid){
p_caster->addInFightTicks(true);
}
else{
p_caster->addInFightTicks();
}
}
}

Item* item = Item::CreateItem(itemId);

if(caster){
item->setOwner(caster->getID());
}

ReturnValue ret = g_game.internalAddItem(tile, item);
if(ret == RET_NOERROR){
g_game.startDecay(item);
}
else{
delete item;
}
}

if(params.tileCallback){
params.tileCallback->onTileCombat(caster, tile);
}

if(params.impactEffect != NM_ME_NONE){
g_game.addMagicEffect(list, tile->getPosition(), params.impactEffect);
}
}

void Combat::postCombatEffects(Creature* caster, const Position& pos, const CombatParams& params)
{
if(caster && params.distanceEffect != NM_ME_NONE){
addDistanceEffect(caster, caster->getPosition(), pos, params.distanceEffect);
}
}

void Combat::addDistanceEffect(Creature* caster, const Position& fromPos, const Position& toPos,
uint8_t effect)
{
uint8_t distanceEffect = effect;

if(caster && distanceEffect != NM_ME_NONE){
g_game.addDistanceEffect(fromPos, toPos, distanceEffect);
}
}


void Combat::CombatFunc(Creature* caster, const Position& pos,
const AreaCombat* area, const CombatParams& params, COMBATFUNC func, void* data)
{
std::list<Tile*> tileList;

if(caster){
getCombatArea(caster->getPosition(), pos, area, tileList);
}
else{
getCombatArea(pos, pos, area, tileList);
}

SpectatorVec list;
uint32_t maxX = 0;
uint32_t maxY = 0;
uint32_t diff;

//calculate the max viewable range
for(std::list<Tile*>::iterator it = tileList.begin(); it != tileList.end(); ++it){
diff = std::abs((*it)->getPosition().x - pos.x);
if(diff > maxX){
maxX = diff;
}

diff = std::abs((*it)->getPosition().y - pos.y);
if(diff > maxY){
maxY = diff;
}
}

g_game.getSpectators(list, pos, false, true, maxX + Map::maxViewportX, maxX + Map::maxViewportX,
maxY + Map::maxViewportY, maxY + Map::maxViewportY);

for(std::list<Tile*>::iterator it = tileList.begin(); it != tileList.end(); ++it){
bool bContinue = true;

if(canDoCombat(caster, *it, params.isAggressive) == RET_NOERROR){
for(CreatureVector::iterator cit = (*it)->creatures.begin(); bContinue && cit != (*it)->creatures.end(); ++cit){
if(params.targetCasterOrTopMost){

if(g_config.getBoolean(ConfigManager::UH_TRAP) == false &&
(caster && caster->getTile() == (*it))){
if(*cit == caster){
bContinue = false;
}
}
else if(*cit == (*it)->getTopCreature()){
bContinue = false;
}

if(bContinue){
continue;
}
}

if(!params.isAggressive || (caster != *cit && Combat::canDoCombat(caster, *cit) == RET_NOERROR)){
func(caster, *cit, params, data);

if(params.targetCallback){
params.targetCallback->onTargetCombat(caster, *cit);
}
}
}

combatTileEffects(list, caster, *it, params);
}
}

postCombatEffects(caster, pos, params);
}

void Combat::doCombat(Creature* caster, Creature* target) const
{
//target combat callback function

if(params.combatType != COMBAT_NONE){
int32_t minChange = 0;
int32_t maxChange = 0;
getMinMaxValues(caster, target, minChange, maxChange);

if(params.combatType != COMBAT_MANADRAIN){
doCombatHealth(caster, target, minChange, maxChange, params);
}
else{
doCombatMana(caster, target, minChange, maxChange, params);
}
}
else{
doCombatDefault(caster, target, params);
}
}

void Combat::doCombat(Creature* caster, const Position& pos) const
{
//area combat callback function

if(params.combatType != COMBAT_NONE){
int32_t minChange = 0;
int32_t maxChange = 0;
getMinMaxValues(caster, NULL, minChange, maxChange);

if(params.combatType != COMBAT_MANADRAIN){
doCombatHealth(caster, pos, area, minChange, maxChange, params);
}
else{
doCombatMana(caster, pos, area, minChange, maxChange, params);
}
}
else{
CombatFunc(caster, pos, area, params, CombatNullFunc, NULL);
}
}

void Combat::doCombatHealth(Creature* caster, Creature* target,
int32_t minChange, int32_t maxChange, const CombatParams& params)
{
if(!params.isAggressive || (caster != target && Combat::canDoCombat(caster, target) == RET_NOERROR)){
Combat2Var var;
var.minChange = minChange;
var.maxChange = maxChange;
CombatHealthFunc(caster, target, params, (void*)&var);

if(params.impactEffect != NM_ME_NONE){
g_game.addMagicEffect(target->getPosition(), params.impactEffect);
}

if(caster && params.distanceEffect != NM_ME_NONE){
addDistanceEffect(caster, caster->getPosition(), target->getPosition(), params.distanceEffect);
}
}
}

void Combat::doCombatHealth(Creature* caster, const Position& pos,
const AreaCombat* area, int32_t minChange, int32_t maxChange, const CombatParams& params)
{
Combat2Var var;
var.minChange = minChange;
var.maxChange = maxChange;

CombatFunc(caster, pos, area, params, CombatHealthFunc, (void*)&var);
}

void Combat::doCombatMana(Creature* caster, Creature* target,
int32_t minChange, int32_t maxChange, const CombatParams& params)
{
if(!params.isAggressive || (caster != target && Combat::canDoCombat(caster, target) == RET_NOERROR)){
Combat2Var var;
var.minChange = minChange;
var.maxChange = maxChange;
CombatManaFunc(caster, target, params, (void*)&var);

if(params.targetCallback){
params.targetCallback->onTargetCombat(caster, target);
}

if(params.impactEffect != NM_ME_NONE){
g_game.addMagicEffect(target->getPosition(), params.impactEffect);
}

if(caster && params.distanceEffect != NM_ME_NONE){
addDistanceEffect(caster, caster->getPosition(), target->getPosition(), params.distanceEffect);
}
}
}

void Combat::doCombatMana(Creature* caster, const Position& pos,
const AreaCombat* area, int32_t minChange, int32_t maxChange, const CombatParams& params)
{
Combat2Var var;
var.minChange = minChange;
var.maxChange = maxChange;

CombatFunc(caster, pos, area, params, CombatManaFunc, (void*)&var);
}

void Combat::doCombatCondition(Creature* caster, const Position& pos, const AreaCombat* area,
const CombatParams& params)
{
CombatFunc(caster, pos, area, params, CombatConditionFunc, NULL);
}

void Combat::doCombatCondition(Creature* caster, Creature* target, const CombatParams& params)
{
if(!params.isAggressive || (caster != target && Combat::canDoCombat(caster, target) == RET_NOERROR)){
CombatConditionFunc(caster, target, params, NULL);

if(params.targetCallback){
params.targetCallback->onTargetCombat(caster, target);
}

if(params.impactEffect != NM_ME_NONE){
g_game.addMagicEffect(target->getPosition(), params.impactEffect);
}

if(caster && params.distanceEffect != NM_ME_NONE){
addDistanceEffect(caster, caster->getPosition(), target->getPosition(), params.distanceEffect);
}
}
}

void Combat::doCombatDispel(Creature* caster, const Position& pos, const AreaCombat* area,
const CombatParams& params)
{
CombatFunc(caster, pos, area, params, CombatDispelFunc, NULL);
}

void Combat::doCombatDispel(Creature* caster, Creature* target, const CombatParams& params)
{
if(!params.isAggressive || (caster != target && Combat::canDoCombat(caster, target) == RET_NOERROR)){
CombatDispelFunc(caster, target, params, NULL);

if(params.targetCallback){
params.targetCallback->onTargetCombat(caster, target);
}

if(params.impactEffect != NM_ME_NONE){
g_game.addMagicEffect(target->getPosition(), params.impactEffect);
}

if(caster && params.distanceEffect != NM_ME_NONE){
addDistanceEffect(caster, caster->getPosition(), target->getPosition(), params.distanceEffect);
}
}
}

void Combat::doCombatDefault(Creature* caster, Creature* target, const CombatParams& params)
{
if(!params.isAggressive || (caster != target && Combat::canDoCombat(caster, target) == RET_NOERROR)){
const SpectatorVec& list = g_game.getSpectators(target->getTile()->getPosition());
CombatNullFunc(caster, target, params, NULL);
combatTileEffects(list, caster, target->getTile(), params);

if(params.targetCallback){
params.targetCallback->onTargetCombat(caster, target);
}

if(params.impactEffect != NM_ME_NONE){
g_game.addMagicEffect(target->getPosition(), params.impactEffect);
}

if(caster && params.distanceEffect != NM_ME_NONE){
addDistanceEffect(caster, caster->getPosition(), target->getPosition(), params.distanceEffect);
}
}
}

//**********************************************************

void ValueCallback::getMinMaxValues(Player* player, int32_t& min, int32_t& max, bool useCharges) const
{
//"onGetPlayerMinMaxValues"(...)
if(m_scriptInterface->reserveScriptEnv()){
ScriptEnviroment* env = m_scriptInterface->getScriptEnv();
lua_State* L = m_scriptInterface->getLuaState();

if(!env->setCallbackId(m_scriptId, m_scriptInterface))
return;

uint32_t cid = env->addThing(player);

m_scriptInterface->pushFunction(m_scriptId);
lua_pushnumber(L, cid);

int32_t parameters = 1;

switch(type){
case FORMULA_LEVELMAGIC:
{
//"onGetPlayerMinMaxValues"(cid, level, maglevel)
lua_pushnumber(L, player->getLevel());
lua_pushnumber(L, player->getMagicLevel());
parameters += 2;
break;
}

case FORMULA_SKILL:
{
//"onGetPlayerMinMaxValues"(cid, attackSkill, attackValue, attackFactor)
Item* tool = player->getWeapon();
int32_t attackSkill = player->getWeaponSkill(tool);
int32_t attackValue = 7;
if(tool){
attackValue = tool->getAttack();

if(useCharges && tool->hasCharges() && g_config.getNumber(ConfigManager::REMOVE_WEAPON_CHARGES)){
int32_t newCharge = std::max(0, tool->getCharges() - 1);
g_game.transformItem(tool, tool->getID(), newCharge);
}
}
float attackFactor = player->getAttackFactor();

lua_pushnumber(L, attackSkill);
lua_pushnumber(L, attackValue);
lua_pushnumber(L, attackFactor);
parameters += 3;
break;
}

default:
std::cout << "ValueCallback::getMinMaxValues - unknown callback type" << std::endl;
return;
break;
}

int size0 = lua_gettop(L);
if(lua_pcall(L, parameters, 2 /*nReturnValues*/, 0) != 0){
LuaScriptInterface::reportError(NULL, std::string(LuaScriptInterface::popString(L)));
}
else{
max = LuaScriptInterface::popNumber(L);
min = LuaScriptInterface::popNumber(L);
}

if((lua_gettop(L) + parameters /*nParams*/ + 1) != size0){
LuaScriptInterface::reportError(NULL, "Stack size changed!");
}

env->resetCallback();
m_scriptInterface->releaseScriptEnv();
}
else{
std::cout << "[Error] Call stack overflow. ValueCallback::getMinMaxValues" << std::endl;
return;
}
}

//**********************************************************

void TileCallback::eek:nTileCombat(Creature* creature, Tile* tile) const
{
//"onTileCombat"(cid, pos)
if(m_scriptInterface->reserveScriptEnv()){
ScriptEnviroment* env = m_scriptInterface->getScriptEnv();
lua_State* L = m_scriptInterface->getLuaState();

if(!env->setCallbackId(m_scriptId, m_scriptInterface))
return;

uint32_t cid = 0;

if(creature){
cid = env->addThing(creature);
}

m_scriptInterface->pushFunction(m_scriptId);
lua_pushnumber(L, cid);
m_scriptInterface->pushPosition(L, tile->getPosition(), 0);

m_scriptInterface->callFunction(2);

env->resetCallback();
m_scriptInterface->releaseScriptEnv();
}
else{
std::cout << "[Error] Call stack overflow. TileCallback::eek:nTileCombat" << std::endl;
return;
}
}

//**********************************************************

void TargetCallback::eek:nTargetCombat(Creature* creature, Creature* target) const
{
//"onTargetCombat"(cid, target)
if(m_scriptInterface->reserveScriptEnv()){
ScriptEnviroment* env = m_scriptInterface->getScriptEnv();
lua_State* L = m_scriptInterface->getLuaState();

if(!env->setCallbackId(m_scriptId, m_scriptInterface))
return;

uint32_t cid = 0;

if(creature){
cid = env->addThing(creature);
}

uint32_t targetCid = env->addThing(target);

m_scriptInterface->pushFunction(m_scriptId);
lua_pushnumber(L, cid);
lua_pushnumber(L, targetCid);

int size0 = lua_gettop(L);
if(lua_pcall(L, 2, 0 /*nReturnValues*/, 0) != 0){
LuaScriptInterface::reportError(NULL, std::string(LuaScriptInterface::popString(L)));
}

if((lua_gettop(L) + 2 /*nParams*/ + 1) != size0){
LuaScriptInterface::reportError(NULL, "Stack size changed!");
}

env->resetCallback();
m_scriptInterface->releaseScriptEnv();
}
else{
std::cout << "[Error] Call stack overflow. TargetCallback::eek:nTargetCombat" << std::endl;
return;
}
}

//**********************************************************

void AreaCombat::clear()
{
for(AreaCombatMap::iterator it = areas.begin(); it != areas.end(); ++it){
delete it->second;
}

areas.clear();
}

AreaCombat::AreaCombat(const AreaCombat& rhs)
{
hasExtArea = rhs.hasExtArea;

for(AreaCombatMap::const_iterator it = rhs.areas.begin(); it != rhs.areas.end(); ++it){
areas[it->first] = new MatrixArea(*it->second);
}
}

bool AreaCombat::getList(const Position& centerPos, const Position& targetPos, std::list<Tile*>& list) const
{
Tile* tile = g_game.getTile(targetPos.x, targetPos.y, targetPos.z);

const MatrixArea* area = getArea(centerPos, targetPos);
if(!area){
return false;
}

Position tmpPos = targetPos;

size_t cols = area->getCols();
size_t rows = area->getRows();

uint32_t centerY, centerX;
area->getCenter(centerY, centerX);

tmpPos.x -= centerX;
tmpPos.y -= centerY;

for(size_t y = 0; y < rows; ++y){
for(size_t x = 0; x < cols; ++x){

if(area->getValue(y, x) != 0){
if(tmpPos.x >= 0 && tmpPos.y >= 0 && tmpPos.z >= 0 &&
tmpPos.x <= 0xFFFF && tmpPos.y <= 0xFFFF && tmpPos.z < MAP_MAX_LAYERS)
{
if(g_game.isSightClear(targetPos, tmpPos, true)){
tile = g_game.getTile(tmpPos.x, tmpPos.y, tmpPos.z);
if(!tile){
tile = new Tile(tmpPos.x, tmpPos.y, tmpPos.z);
g_game.setTile(tile);
}
list.push_back(tile);
}
}
}

tmpPos.x += 1;
}

tmpPos.x -= cols;
tmpPos.y += 1;
}

return true;
}

int32_t round(float v)
{
int32_t t = (int32_t)std::floor(v);
if((v - t) > 0.5){
return t + 1;
}
else{
return t;
}
}

void AreaCombat::copyArea(const MatrixArea* input, MatrixArea* output, MatrixOperation_t op) const
{
uint32_t centerY, centerX;
input->getCenter(centerY, centerX);

if(op == MATRIXOPERATION_COPY){
for(unsigned int y = 0; y < input->getRows(); ++y){
for(unsigned int x = 0; x < input->getCols(); ++x){
(*output)[y][x] = (*input)[y][x];
}
}

output->setCenter(centerY, centerX);
}
else if(op == MATRIXOPERATION_MIRROR){
for(unsigned int y = 0; y < input->getRows(); ++y){
int rx = 0;
for(int x = input->getCols() - 1; x >= 0; --x){
(*output)[y][rx++] = (*input)[y][x];
}
}

output->setCenter(centerY, (input->getRows() - 1) - centerX);
}
else if(op == MATRIXOPERATION_FLIP){
for(unsigned int x = 0; x < input->getCols(); ++x){
int ry = 0;
for(int y = input->getRows() - 1; y >= 0; --y){
(*output)[ry++][x] = (*input)[y][x];
}
}

output->setCenter((input->getCols() - 1) - centerY, centerX);
}
//rotation
else{
uint32_t centerX, centerY;
input->getCenter(centerY, centerX);

int32_t rotateCenterX = (output->getCols() / 2) - 1;
int32_t rotateCenterY = (output->getRows() / 2) - 1;
int32_t angle = 0;

switch(op){
case MATRIXOPERATION_ROTATE90:
angle = 90;
break;

case MATRIXOPERATION_ROTATE180:
angle = 180;
break;

case MATRIXOPERATION_ROTATE270:
angle = 270;
break;

default:
angle = 0;
break;
}
double angleRad = 3.1416 * angle / 180.0;

float a = std::cos(angleRad);
float b = -std::sin(angleRad);
float c = std::sin(angleRad);
float d = std::cos(angleRad);

for(int32_t x = 0; x < (int32_t)input->getCols(); ++x){
for(int32_t y = 0; y < (int32_t)input->getRows(); ++y){
//calculate new coordinates using rotation center
int32_t newX = x - centerX;
int32_t newY = y - centerY;

//perform rotation
int32_t rotatedX = round(newX * a + newY * b);
int32_t rotatedY = round(newX * c + newY * d);

//write in the output matrix using rotated coordinates
(*output)[rotatedY + rotateCenterY][rotatedX + rotateCenterX] = (*input)[y][x];
}
}

output->setCenter(rotateCenterY, rotateCenterX);
}
}

MatrixArea* AreaCombat::createArea(const std::list<uint32_t>& list, uint32_t rows)
{
unsigned int cols = list.size() / rows;
MatrixArea* area = new MatrixArea(rows, cols);

uint32_t x = 0;
uint32_t y = 0;

for(std::list<uint32_t>::const_iterator it = list.begin(); it != list.end(); ++it){
if(*it == 1 || *it == 3){
area->setValue(y, x, true);
}

if(*it == 2 || *it == 3){
area->setCenter(y, x);
}

++x;

if(cols == x){
x = 0;
++y;
}
}

return area;
}

void AreaCombat::setupArea(const std::list<uint32_t>& list, uint32_t rows)
{
MatrixArea* area = createArea(list, rows);

//NORTH
areas[NORTH] = area;

uint32_t maxOutput = std::max(area->getCols(), area->getRows()) * 2;

//SOUTH
MatrixArea* southArea = new MatrixArea(maxOutput, maxOutput);
copyArea(area, southArea, MATRIXOPERATION_ROTATE180);
areas[SOUTH] = southArea;

//EAST
MatrixArea* eastArea = new MatrixArea(maxOutput, maxOutput);
copyArea(area, eastArea, MATRIXOPERATION_ROTATE90);
areas[EAST] = eastArea;

//WEST
MatrixArea* westArea = new MatrixArea(maxOutput, maxOutput);
copyArea(area, westArea, MATRIXOPERATION_ROTATE270);
areas[WEST] = westArea;
}

void AreaCombat::setupArea(int32_t length, int32_t spread)
{
std::list<uint32_t> list;

uint32_t rows = length;
int32_t cols = 1;

if(spread != 0){
cols = ((length - length % spread) / spread) * 2 + 1;
}

int32_t colSpread = cols;

for(uint32_t y = 1; y <= rows; ++y){
int32_t mincol = cols - colSpread + 1;
int32_t maxcol = cols - (cols - colSpread);
for(int32_t x = 1; x <= cols; ++x){
if(y == rows && x == ((cols - cols % 2) / 2) + 1){
list.push_back(3);
}
else if(x >= mincol && x <= maxcol){
list.push_back(1);
}
else{
list.push_back(0);
}
}

if(spread > 0 && y % spread == 0){
--colSpread;
}
}

setupArea(list, rows);
}

void AreaCombat::setupArea(int32_t radius)
{
int32_t area[13][13] = {
{0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 8, 8, 7, 8, 8, 0, 0, 0, 0},
{0, 0, 0, 8, 7, 6, 6, 6, 7, 8, 0, 0, 0},
{0, 0, 8, 7, 6, 5, 5, 5, 6, 7, 8, 0, 0},
{0, 8, 7, 6, 5, 4, 4, 4, 5, 6, 7, 8, 0},
{0, 8, 6, 5, 4, 3, 2, 3, 4, 5, 6, 8, 0},
{8, 7, 6, 5, 4, 2, 1, 2, 4, 5, 6, 7, 8},
{0, 8, 6, 5, 4, 3, 2, 3, 4, 5, 6, 8, 0},
{0, 8, 7, 6, 5, 4, 4, 4, 5, 6, 7, 8, 0},
{0, 0, 8, 7, 6, 5, 5, 5, 6, 7, 8, 0, 0},
{0, 0, 0, 8, 7, 6, 6, 6, 7, 8, 0, 0, 0},
{0, 0, 0, 0, 8, 8, 7, 8, 8, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0}
};

std::list<uint32_t> list;

for(int32_t y = 0; y < 13; ++y){
for(int32_t x = 0; x < 13; ++x){
if(area[y][x] == 1){
list.push_back(3);
}
else if(area[y][x] > 0 && area[y][x] <= radius){
list.push_back(1);
}
else{
list.push_back(0);
}
}
}

setupArea(list, 13);
}

void AreaCombat::setupExtArea(const std::list<uint32_t>& list, uint32_t rows)
{
if(list.empty()){
return;
}

hasExtArea = true;
MatrixArea* area = createArea(list, rows);

//NORTH-WEST
areas[NORTHWEST] = area;

uint32_t maxOutput = std::max(area->getCols(), area->getRows()) * 2;

//NORTH-EAST
MatrixArea* neArea = new MatrixArea(maxOutput, maxOutput);
copyArea(area, neArea, MATRIXOPERATION_MIRROR);
areas[NORTHEAST] = neArea;

//SOUTH-WEST
MatrixArea* swArea = new MatrixArea(maxOutput, maxOutput);
copyArea(area, swArea, MATRIXOPERATION_FLIP);
areas[SOUTHWEST] = swArea;

//SOUTH-EAST
MatrixArea* seArea = new MatrixArea(maxOutput, maxOutput);
copyArea(swArea, seArea, MATRIXOPERATION_MIRROR);
areas[SOUTHEAST] = seArea;
}

//**********************************************************

void MagicField::eek:nStepInField(Creature* creature, bool purposeful/*= true*/)
{
//remove magic walls/wild growth
if(isBlocking()){
g_game.internalRemoveItem(this, 1);
}
else{
const ItemType& it = items[getID()];
if(it.condition){
Condition* conditionCopy = it.condition->clone();
uint32_t owner = getOwner();
if(owner != 0 && purposeful){
bool harmfulField = true;
if(g_game.getWorldType() == WORLD_TYPE_NO_PVP || getTile()->hasFlag(TILESTATE_NOPVPZONE) ){
Creature* creature = g_game.getCreatureByID(owner);
if(creature){
if(creature->getPlayer() || (creature->isSummon() && creature->getMaster()->getPlayer())){
harmfulField = false;
}
}
}
if( !harmfulField ||
(OTSYS_TIME() - createTime <= g_config.getNumber(ConfigManager::FIELD_OWNERSHIP_DURATION)) ||
creature->hasBeenAttacked(owner))
{
conditionCopy->setParam(CONDITIONPARAM_OWNER, owner);
}
}

creature->addCondition(conditionCopy);
}
}
}
 
Last edited:

DiS

Advanced User
Joined
Apr 5, 2008
Messages
274
Reaction score
12
Odp: Kompilacja

Dobra ju? wiem. To by?y tylko ostrze?enia i silnik normalnie si? kompiluje. Problem, ?e sypa? miliony b??d?w by? (domy?lam si?):
Silnik kt?ry na gotowo udost?pni? autor (Ferrus) dzia?a ok i jest najwidoczniej oparty na source rev94
Source kt?re mo?na pobra? ze strony autora jest w wersji rev102 i nie jest kompatybilne ze skryptami dzia?aj?cymi pod te starsze ?r?d?a.. Uda?o mi si? pobra? source rev94 i po kompilacji dzia?a bez b?ed?w..
Trudno mi by?o na to wpa??, gdy? obydwa ?r?d?a s? oznaczone jako wersja silnika 0.6.5
 
Status
Not open for further replies.
Top