Could Flippable Turrets be made to work with Turret Loadouts by WhiteThunder?

As per the title, could flippable turrets be made to work with Turret loadouts by WhiteThunder?

If someone else gets to this before me, the approach I suggest is to use call the standard Oxide hook that is called when a player builds a turret. Off the top of my head, that is OnEntityBuilt. Both Car Turrets and Drone Turrets have examples of calling this hook.

Merged post

I submitted a patch for this. Awaiting review by the maintainer. Below is the updated method. You can replace the current CheckInput method with this. There is really only one new line of code, but I improved naming and readability a bit since I saw somebody complain before that this plugin's code was confusing.

private void CheckInput(BasePlayer player, InputState input)
{
    if (!input.WasJustPressed(BUTTON.FIRE_PRIMARY))
        return;

    var heldItem = player.GetActiveItem();
    if (heldItem == null
        || heldItem?.info?.shortname != "autoturret"
        || !permission.UserHasPermission(player.UserIDString, permUse)
        || !player.CanBuild())
        return;

    RaycastHit rhit;
    if (!Physics.Raycast(player.eyes.HeadRay(), out rhit))
        return;

    var entity = rhit.GetEntity();
    if (entity == null
        || rhit.distance > 5f
        || !entity.ShortPrefabName.Contains("floor")
        || entity.transform.position.y <= player.transform.position.y)
        return;

    var turret = GameManager.server.CreateEntity(prefab);
    if (turret == null)
        return;

    turret.transform.position = rhit.point;
    turret.transform.LookAt(player.transform);
    turret.transform.Rotate(-45, 0, 180);
    turret.OwnerID = player.userID;
    turret.Spawn();

    Interface.CallHook("OnEntityBuilt", heldItem.GetHeldEntity(), turret.gameObject);
    player.inventory.Take(null, heldItem.info.itemid, 1);
}​

Sorry boys, i was away. Patch merged