mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
Move "getNPC" that was introduced in commit
00729bbc2e
from Spawn to CreatureType
I didn't have a closer look at how his code was structured, what he
basically did
is that he set all creatures in a spawn as NPC's even if it's a monster
which is
so erroneous.
Highlights:
- Add branch prediction macros
- Minor code style fixes & some others
Hopefully the branch prediction thing will speed up OTB since it's
awfully slow.
This commit is contained in:
@@ -33,8 +33,23 @@
|
||||
#error "Compiler not supported."
|
||||
#endif
|
||||
|
||||
/// Branch Prediction. See the GCC Manual for more information.
|
||||
/// NB: These are used when speed is need most; do not use in normal
|
||||
/// code, they may slow down stuff.
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#error "Sorry, you must enable C++0x to compile."
|
||||
#error "C++0x is required to compile this application. Try updating your compiler."
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#warning "MSVC lacks some C++11 features used in this application; compilation is most likely to fail."
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user