Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
This commit is contained in:
@@ -31,7 +31,7 @@ void Spider::defineSynchedData()
|
||||
{
|
||||
Monster::defineSynchedData();
|
||||
|
||||
entityData->define(DATA_FLAGS_ID, static_cast<byte>(0));
|
||||
entityData->define(DATA_FLAGS_ID, (byte) 0);
|
||||
}
|
||||
|
||||
void Spider::tick()
|
||||
@@ -109,7 +109,7 @@ void Spider::checkHurtTarget(shared_ptr<Entity> target, float d)
|
||||
{
|
||||
double xdd = target->x - x;
|
||||
double zdd = target->z - z;
|
||||
float dd = static_cast<float>(sqrt(xdd * xdd + zdd * zdd));
|
||||
float dd = (float) sqrt(xdd * xdd + zdd * zdd);
|
||||
xd = (xdd / dd * 0.5f) * 0.8f + xd * 0.2f;
|
||||
zd = (zdd / dd * 0.5f) * 0.8f + zd * 0.2f;
|
||||
yd = 0.4f;
|
||||
@@ -195,26 +195,26 @@ MobGroupData *Spider::finalizeMobSpawn(MobGroupData *groupData, int extraData /*
|
||||
if (level->random->nextInt(100) == 0)
|
||||
#endif
|
||||
{
|
||||
shared_ptr<Skeleton> skeleton = std::make_shared<Skeleton>(level);
|
||||
shared_ptr<Skeleton> skeleton = shared_ptr<Skeleton>( new Skeleton(level) );
|
||||
skeleton->moveTo(x, y, z, yRot, 0);
|
||||
skeleton->finalizeMobSpawn(nullptr);
|
||||
skeleton->finalizeMobSpawn(NULL);
|
||||
level->addEntity(skeleton);
|
||||
skeleton->ride(shared_from_this());
|
||||
}
|
||||
|
||||
if (groupData == nullptr)
|
||||
if (groupData == NULL)
|
||||
{
|
||||
groupData = new SpiderEffectsGroupData();
|
||||
|
||||
if (level->difficulty > Difficulty::NORMAL && level->random->nextFloat() < SPIDER_SPECIAL_EFFECT_CHANCE * level->getDifficulty(x, y, z))
|
||||
{
|
||||
static_cast<SpiderEffectsGroupData *>(groupData)->setRandomEffect(level->random);
|
||||
((SpiderEffectsGroupData *) groupData)->setRandomEffect(level->random);
|
||||
}
|
||||
}
|
||||
if ( dynamic_cast<SpiderEffectsGroupData *>( groupData ) != nullptr)
|
||||
if ( dynamic_cast<SpiderEffectsGroupData *>( groupData ) != NULL)
|
||||
{
|
||||
int effect = static_cast<SpiderEffectsGroupData *>(groupData)->effectId;
|
||||
if (effect > 0 && MobEffect::effects[effect] != nullptr)
|
||||
int effect = ((SpiderEffectsGroupData *) groupData)->effectId;
|
||||
if (effect > 0 && MobEffect::effects[effect] != NULL)
|
||||
{
|
||||
addEffect(new MobEffectInstance(effect, Integer::MAX_VALUE));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user