| 891 | snprintf(path, sizeof(path), "%s\\%s", (const char*)dir, c->relPath); |
| 892 | c->result = path; |
| 893 | return true; |
| 894 | } |
| 895 | return false; |
| 896 | } |
| 897 | |
| 898 | RString CreateSingleMissionBank(RString filename) |
| 899 | { |
| 900 | // suppose filename is without extension (.pbo) |
| 901 | |
| 902 | // Remove the previously created __cur_sp bank(s). Match with CmpStartStr — |
| 903 | // the same separator- and case-insensitive prefix test AutoBank uses to |
| 904 | // resolve reads. A plain strnicmp here is separator-sensitive, and |
| 905 | // SetPrefix() stores the prefix with platform-native separators |
| 906 | // (backslash -> slash on POSIX): on Linux the literal backslash prefix never |
| 907 | // matched, so old banks leaked and every template resolved to the first |
| 908 | // stale __cur_sp bank. |
| 909 | const char* prefix = "missions\\__cur_sp."; |
| 910 | for (int i = 0; i < GFileBanks.Size();) |
| 911 | { |
| 912 | QFBank& bank = GFileBanks[i]; |
| 913 | if (CmpStartStr(bank.GetPrefix(), prefix) == 0) |
| 914 | { |
| 915 | if (GFileServer) |
| 916 | { |
| 917 | GFileServer->FlushBank(&bank); |
| 918 | } |
| 919 | if (GEngine && GEngine->TextBank()) |
| 920 | { |
| 921 | GEngine->TextBank()->FlushBank(&bank); |
| 922 | } |
| 923 | if (GSoundsys) |
| 924 | { |
| 925 | GSoundsys->FlushBank(&bank); |
| 926 | } |
| 927 | GFileBanks.Delete(i); |
| 928 | } |
| 929 | else |
| 930 | { |
| 931 | i++; |
| 932 | } |
| 933 | } |
| 934 | |
| 935 | // extract island name |
| 936 | const char* ext = strrchr(filename, '.'); |
| 937 | if (!ext) |
| 938 | { |
| 939 | return ""; |
| 940 | } |
| 941 | RString island = ext + 1; |
no test coverage detected