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

AIVehicleList_DefaultGroup fail to return vehicle in default group #6289

Closed
DorpsGek opened this issue Apr 27, 2015 · 1 comment
Closed

AIVehicleList_DefaultGroup fail to return vehicle in default group #6289

DorpsGek opened this issue Apr 27, 2015 · 1 comment
Labels
bug Something isn't working component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) needs triage This issue needs further investigation before it becomes actionable stale Stale issues

Comments

@DorpsGek
Copy link
Member

krinn opened the ticket and wrote:

http://noai.openttd.org/docs/trunk/classAIVehicleList__DefaultGroup.html

While previously i could find vehicle that aren't group (the ones then hold in default group), it's no more working.

To test, use any AI that have vehicles in a group and test with
local test = AIVehicleList_DefaultGroup(AIVehicle.VT_????);
print("vehicle in default group: "+test.Count());

Result: test.Count() will return the same value as if you use test = AIVehicleList(); test.Valuate(AIVehicle.GetVehicleType); test.KeepValue(AIVehicle.VT_????);
So it will no more return the list of vehicle in default group, but a list of all vehicle for the choosen vehicletype, making finding ungroup vehicle impossible with this function.
It's like someone has change GROUP_DEFAULT to GROUP_ALL -> http://noai.openttd.org/docs/trunk/classAIGroup.html# 32649deb2c729e4fc60b67cf5e50488d

I don't really get it as line 126 from trunk : http://hg.openttd.org/trunk.hg/file/2260f1ed74bf/src/script/api/script_vehiclelist.cpp
is fine and have the proper filter v->group_id == ScriptGroup::GROUP_DEFAULT
So maybe it was fix in trunk???

Here's a simple test output:

local dead = AIVehicleList_DefaultGroup(AIVehicle.VT_RAIL);
print("defgroup size:"+dead.Count());
foreach (veh, _ in dead) { print("Veh:"+AIVehicle.GetName(veh)+" group:"+AIVehicle.GetGroupID(veh)+" gname:"+AIGroup.GetName(AIVehicle.GetGroupID(veh))); }
dbg: [script] [1] [P] defgroup size:14
dbg: [script] [1] [P] Veh:Train 14 group:8 gname:A0T3T6515212
dbg: [script] [1] [P] Veh:Train 12 group:8 gname:A0T3T6515212
dbg: [script] [1] [P] Veh:Train 11 group:7 gname:A0T13T51434412
dbg: [script] [1] [P] Veh:Train 10 group:7 gname:A0T13T51434412
dbg: [script] [1] [P] Veh:Train 9 group:6 gname:A0T4T20353612
dbg: [script] [1] [P] Veh:Train 13 group:9 gname:A0T42T23616212
dbg: [script] [1] [P] Veh:Train 6 group:4 gname:A1I584I451242514
dbg: [script] [1] [P] Veh:Train 5 group:2 gname:A1I276I835615
dbg: [script] [1] [P] Veh:Train 3 group:3 gname:A1I611I112101613
dbg: [script] [1] [P] Veh:Train 8 group:2 gname:A1I276I835615
dbg: [script] [1] [P] Veh:Train 4 group:4 gname:A1I584I451242514
dbg: [script] [1] [P] Veh:Train 2 group:3 gname:A1I611I112101613
dbg: [script] [1] [P] Veh:Train 7 group:5 gname:A0T29T4430314
dbg: [script] [1] [P] Veh:Train 1 group:2 gname:A1I276I835615

Reported version: 1.4.4
Operating system: Linux


This issue was imported from FlySpray: https://bugs.openttd.org/task/6289
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) bug labels Apr 7, 2018
@andythenorth andythenorth added component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) and removed Script labels Apr 13, 2018
@TrueBrain TrueBrain added needs triage This issue needs further investigation before it becomes actionable bug Something isn't working and removed bug from FlySpray labels Apr 13, 2018
@andythenorth andythenorth added the stale Stale issues label Jan 5, 2019
@andythenorth
Copy link
Contributor

Thanks for this. There's been no activity on this for some time, and as it stands, it doesn't look likely that it will go any further. I'm closing it as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun. Feel free to discuss in irc or request re-opening if you disagree. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) needs triage This issue needs further investigation before it becomes actionable stale Stale issues
Projects
None yet
Development

No branches or pull requests

3 participants