Remove the owner from a horse.

void HorseRemoveOwner(
    object oHorse



The horse whose owner is to be removed.


This function removes the owner from the horse. It will not work on Paladin mounts.


It is not possible to remove the owner of a mounted horse, because no horse object exists at that time.

The owner must be dismounted first.

If the horse object is invalid or has no owner, the function does nothing.

The function removes the owner (which, by definition, unassigns the horse, if it is assigned).

However, because it is an immediate function and not an action, the caller is responsible for clearing the horse's action queue.

If you don't, the horse may continue to follow, even though it's no longer owned.

It's wise to allow a delay of about 1 second to allow the engine to perform "remove henchman" cleanly (maybe longer, if you're making many changes to the henchman list concurrently).

It is not possible to remove the owner of a Paladin mount - use HorseUnsummonPaladinMount if you don't need it anymore.


#include "x3_inc_horse"




// Remove a horse from a PC
// In this simple example, only one horse is removed - there could be more.

#include "x3_inc_horse"
void main()
   object oPC = GetPCSpeaker(); 
   object oMyHorse = HorseGetHorse(oPC);

HorseRemoveOwner(oMyHorse); DelayCommand(1.0, AssignCommand(oMyHorse, ClearAllActions())); }

See Also

functions:  HorseSetOwner | HorseGetCanBeMounted | HorseGetHorse | HorseGetMyHorse | HorseGetHasAHorse
categories:  Horse Functions

author: Proleric, editor: Mistress