void ARX_THROWN_OBJECT_Throw(EntityHandle source, const Vec3f & position, const Vec3f & vect, const glm::quat & quat, float velocity, float damages, float poison) { arx_assert(arrowobj); long num = ARX_THROWN_OBJECT_GetFree(); if(num < 0) return; ARX_THROWN_OBJECT *thrownObj = &Thrown[num]; thrownObj->damages = damages; thrownObj->position = position; thrownObj->initial_position = position; thrownObj->vector = vect; thrownObj->quat = quat; thrownObj->source = source; thrownObj->obj = arrowobj; thrownObj->velocity = velocity; thrownObj->poisonous = poison; thrownObj->pRuban = new ArrowTrail(); thrownObj->pRuban->SetNextPosition(thrownObj->position); thrownObj->pRuban->Update(framedelay); thrownObj->creation_time = (unsigned long)(arxtime); thrownObj->flags |= ATO_EXIST | ATO_MOVING; if(source == 0 && ValidIONum(player.equiped[EQUIP_SLOT_WEAPON]) ) { Entity * tio = entities[player.equiped[EQUIP_SLOT_WEAPON]]; if(tio->ioflags & IO_FIERY) thrownObj->flags |= ATO_FIERY; } }
void ARX_THROWN_OBJECT_Throw(EntityHandle source, const Vec3f & position, const Vec3f & vect, const glm::quat & quat, float velocity, float damages, float poison) { arx_assert(arrowobj); long num = ARX_THROWN_OBJECT_GetFree(); if(num < 0) return; Projectile & projectile = g_projectiles[num]; projectile.damages = damages; projectile.position = position; projectile.initial_position = position; projectile.vector = vect; projectile.quat = quat; projectile.source = source; projectile.obj = arrowobj; projectile.velocity = velocity; projectile.poisonous = poison; projectile.m_trail = new ArrowTrail(); projectile.m_trail->SetNextPosition(projectile.position); projectile.m_trail->Update(g_framedelay); projectile.creation_time = arxtime.now_ul(); projectile.flags |= ATO_EXIST | ATO_MOVING; if(source == PlayerEntityHandle && ValidIONum(player.equiped[EQUIP_SLOT_WEAPON]) ) { Entity * tio = entities[player.equiped[EQUIP_SLOT_WEAPON]]; if(tio->ioflags & IO_FIERY) projectile.flags |= ATO_FIERY; } }