v3f ppos = m_player->getPosition() / BS;
v3f pos = random_v3f(m_minpos, m_maxpos);
+ // Need to apply this first or the following check
+ // will be wrong for attached spawners
+ if (is_attached)
+ pos += attached_pos;
+
if (pos.getDistanceFrom(ppos) <= radius) {
v3f vel = random_v3f(m_minvel, m_maxvel);
v3f acc = random_v3f(m_minacc, m_maxacc);
if (is_attached) {
// Apply attachment yaw and position
pos.rotateXZBy(attached_yaw);
- pos += attached_pos;
vel.rotateXZBy(attached_yaw);
acc.rotateXZBy(attached_yaw);
}
v3f ppos = m_player->getPosition() / BS;
v3f pos = random_v3f(m_minpos, m_maxpos);
+ // Need to apply this first or the following check
+ // will be wrong for attached spawners
+ if (is_attached)
+ pos += attached_pos;
+
if (pos.getDistanceFrom(ppos) <= radius) {
v3f vel = random_v3f(m_minvel, m_maxvel);
v3f acc = random_v3f(m_minacc, m_maxacc);
if (is_attached) {
// Apply attachment yaw and position
pos.rotateXZBy(attached_yaw);
- pos += attached_pos;
vel.rotateXZBy(attached_yaw);
acc.rotateXZBy(attached_yaw);
}