Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modded Fixed Guns Can't Be Sorted #11

Open
CovertJaguar opened this issue Mar 6, 2018 · 3 comments
Open

Modded Fixed Guns Can't Be Sorted #11

CovertJaguar opened this issue Mar 6, 2018 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@CovertJaguar
Copy link

CovertJaguar commented Mar 6, 2018

A lot of modded fixed gun blocks are under the hood SmallMissileLaunchers. Because of this, TIM assumes they have no conveyor ports and ignores them. This logic could use some improvement as its not currently possible to use TIM to manage ammo for these weapons.

https://github.com/Gorea235/TaledensInvManagerUpdated/blob/master/src/Script.cs#L1546

if ((block is IMySmallMissileLauncher & !(block is IMySmallMissileLauncherReload | block.BlockDefinition.SubtypeName == "LargeMissileLauncher")) | block is IMyLargeInteriorTurret)
{
         // can't sort with no conveyor port
        invenLocked.Add(block.GetInventory(0));
}

https://github.com/Gorea235/TaledensInvManagerUpdated/blob/master/src/Script.cs#L2048

else if (!block.HasInventory | (block is IMySmallMissileLauncher & !(block is IMySmallMissileLauncherReload | block.BlockDefinition.SubtypeName == "LargeMissileLauncher")) | block is IMyLargeInteriorTurret)
{
    name.Append(String.Join(":", fields).ToLower() + " ");
    debugText.Add("Cannot sort items to " + block.CustomName + ": no conveyor-connected inventory");
}
@CovertJaguar CovertJaguar changed the title Modded Fixed Guns Modded Fixed Guns Can't Be Sorted Mar 6, 2018
@swhutchings
Copy link

swhutchings commented Mar 6, 2018

I was about to submit this too. I haven't tested it thoroughly yet and intend to do so when I have some time, but I'm pretty sure they can just be removed without any adverse effects (but keep the check to see if the block doesn't have an inventory). When the script attempts to move something into them it seems to gracefully fail in the same manner as if the same thing was attempted with the GUI. To maintain the behaviour for vanilla blocks you could just compare the SubtypeName as is done for the LargeMissileLauncher.

@luvies
Copy link
Owner

luvies commented Mar 7, 2018

I can look at a short-term bodge to fix this, but I will keep it in mind when working on #10. I'll likely not hard-code unsortable blocks in that update, meaning that this should become a non-issue.

@luvies luvies self-assigned this Mar 7, 2018
@luvies luvies added the bug Something isn't working label Mar 7, 2018
@mikeloeven
Copy link

mikeloeven commented Apr 24, 2018

Have you tried using the FORCE flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants