MAFINS / MenyooSP

[or Menyoo PC] - Trainer/mod menu for Grand Theft Auto V (single-player).
https://www.gta5-mods.com/scripts/menyoo-pc-sp
GNU General Public License v3.0
776 stars 492 forks source link

"narrowing conversion" required #134

Closed meimeiriver closed 3 years ago

meimeiriver commented 4 years ago

Sorry, but your latest souce no longer compiles properly; various errors like this:

"error C2397: conversion from 'const char [19]' to 'bool' requires a narrowing conversion"

ToxxicFuse commented 4 years ago

You must have done something, it's compiling fine for me

meimeiriver commented 4 years ago

Previous version (from like a month ago, using 16.6.5 worked just fine. Updated to 16.7.1, yesterday, and now Menyoo source (untouched by me) has the compiler crap out all over the place. Many errors like the above, or like 'Error C3861 'sort': identifier not found'. Something must have gone stricter.

DottieDot commented 4 years ago

@meimeiriver is correct. The sort issue just a simple missing include (you need to include ). error C2397: conversion from 'const char [19]' to 'bool' requires a narrowing conversion is caused by a bug fix in MSVC according to themeeman on Discord (The Programmer's Hangout).

Changing std::vector<PCHAR> to std::vector<std::string_view> in TeleLocation's ctors and adding this operator

constexpr std::string_view operator ""_sv(const char* str, std::size_t length)
{
    return str;
}

would be a way to fix this issue with minimal effort.

Usage would be like this:

TeleLocation("Union Depository", 2.6968f, -667.0166f, 16.1306f,{ "FINBANK"_sv },{ "DT1_03_Shutter"_sv, "DT1_03_Gr_Closed"_sv }, false, false, true),

Constructing the vector's explicitly would also be an option, so like this: std::vector<PCHAR>({ "FINBANK" })

FCEFCE64 commented 4 years ago

I have the same issue, the error appears at a couple of lines in the files Locations.cpp and Facilities.cpp. I have done no edits and the errors appear in the lines containing };

This all started after I have installed all packages to my Microsoft Visual Studio 2019. I tried something else before that with only a little amount of packages, the compiling succeeded.

1>------ Erstellen gestartet: Projekt: Menyoo, Konfiguration: Release x64 ------ 1>GTAmemory.cpp 1>Menu.cpp 1>Routine.cpp 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Menu\Routine.cpp(733,3): error C2065: "fw": nichtdeklarierter Bezeichner 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Menu\Routine.cpp(737,44): error C2065: "fw": nichtdeklarierter Bezeichner 1>natives2.cpp 1>CustomHelpText.cpp 1>DxHookIMG.cpp 1>GTAblip.cpp 1>GTAentity.cpp 1>GTAped.cpp 1>GTAplayer.cpp 1>GTAprop.cpp 1>GTAvehicle.cpp 1>Game.cpp 1>GameplayCamera.cpp 1>Model.cpp 1>ModelNames.cpp 1>PTFX.cpp 1>Raycast.cpp 1>Rope.cpp 1>Scaleform.cpp 1>Kompilieren... 1>Tasks.cpp 1>TimecycleModification.cpp 1>WeaponIndivs.cpp 1>World.cpp 1>enums.cpp 1>AnimalRiding.cpp 1>BreatheStuff.cpp 1>CutscenePlayer.cpp 1>FunnyVehicles.cpp 1>GhostRiderMode.cpp 1>MainMenu.cpp 1>MiscMapMods.cpp 1>MiscOptions.cpp 1>PedAnimation.cpp 1>PedComponentChanger.cpp 1>PedModelChanger.cpp 1>PedSpeech.cpp 1>PlayerOptions.cpp 1>Players.cpp 1>PtfxSubs.cpp 1>Kompilieren... 1>Settings.cpp 1>BlipManagement.cpp 1>Databases.cpp 1>EntityManagement.cpp 1>FavouritesManagement.cpp 1>FileManagement.cpp 1>MarkerManagement.cpp 1>MenuOptions.cpp 1>RelationshipManagement.cpp 1>STSTask.cpp 1>STSTasks.cpp 1>SpoonerEntity.cpp 1>SpoonerMarker.cpp 1>SpoonerMode.cpp 1>SpoonerSettings.cpp 1>SpoonerTaskSequence.cpp 1>Submenus.cpp 1>Submenus_TaskSequence.cpp 1>StatManager.cpp 1>ArenaWar.cpp 1>Kompilieren... 1>BikerInteriors.cpp 1>Facilities.cpp 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Facilities.cpp(41,3): error C2397: Die Konvertierung von "const char [60]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Facilities.cpp(41,3): error C2397: Die Konvertierung von "const char [61]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Facilities.cpp(41,3): error C2397: Die Konvertierung von "const char [56]" zu "bool" erfordert eine einschränkende Konvertierung 1>GunRunningInteriors.cpp 1>Hangars.cpp 1>IeVehicleWarehouses.cpp 1>Locations.cpp 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Locations.cpp(286,3): error C2397: Die Konvertierung von "const char [15]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Locations.cpp(315,3): error C2397: Die Konvertierung von "const char [15]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Locations.cpp(377,3): error C2397: Die Konvertierung von "const char [42]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Locations.cpp(377,3): error C2397: Die Konvertierung von "const char [35]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Locations.cpp(377,3): error C2397: Die Konvertierung von "const char [37]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Locations.cpp(552,3): error C2397: Die Konvertierung von "const char [19]" zu "bool" erfordert eine einschränkende Konvertierung 1>C:\Users\FCE\Desktop\MenyooSP-master\Solution\source\Submenus\Teleport\Locations.cpp(552,3): error C2397: Die Konvertierung von "const char [17]" zu "bool" erfordert eine einschränkende Konvertierung 1>Nightclubs.cpp 1>OfficeGarages.cpp 1>TeleLocation.cpp 1>TeleMethods.cpp 1>Teleport_Submenus.cpp 1>Yachts.cpp 1>TimeOptions.cpp 1>VehicleModShop.cpp 1>VehicleOptions.cpp 1>VehicleSpawner.cpp 1>WeaponOptions.cpp 1>WeatherOptions.cpp 1>ExePath.cpp 1>FileLogger.cpp 1>Kompilieren... 1>GTAmath.cpp 1>StringManip.cpp 1>keyboard.cpp 1>main.cpp 1>Die Erstellung des Projekts "Menyoo.vcxproj" ist abgeschlossen -- FEHLER. ========== Erstellen: 0 erfolgreich, 1 fehlerhaft, 0 aktuell, 0 übersprungen ==========

meimeiriver commented 4 years ago

^^ Dot. explained the details well. The VS 2019 update to 16.7.1 simply makes the compiler stricter. MAFINS will simply need to rewrite a few portions inside TeleLocation. Dot's temp solution works, btw; but I figured, since we're likely looking at a new release soon (right?), what with the new game update and all, I will just wait for the fresh new code.

MAFINS commented 4 years ago

^^ Dot. explained the details well. The VS 2019 update to 16.7.1 simply makes the compiler stricter. MAFINS will simply need to rewrite a few portions inside TeleLocation. Dot's temp solution works, btw; but I figured, since we're likely looking at a new release soon (right?), what with the new game update and all, I will just wait for the fresh new code.

Whoa whoa whoa. SOMEBODY needs to rewrite that code.

meimeiriver commented 4 years ago

^^ Dot. explained the details well. The VS 2019 update to 16.7.1 simply makes the compiler stricter. MAFINS will simply need to rewrite a few portions inside TeleLocation. Dot's temp solution works, btw; but I figured, since we're likely looking at a new release soon (right?), what with the new game update and all, I will just wait for the fresh new code.

Whoa whoa whoa. SOMEBODY needs to rewrite that code.

Since it's your code and project, I figured that somebody would be you. :) But one of your contributors (toxxicfuse, maybe?) will be equally fine, of course; as long as it's done. Seriously. Can't downgrade the compiler, so kinda stuck there.

ToxxicFuse commented 4 years ago

^^ Dot. explained the details well. The VS 2019 update to 16.7.1 simply makes the compiler stricter. MAFINS will simply need to rewrite a few portions inside TeleLocation. Dot's temp solution works, btw; but I figured, since we're likely looking at a new release soon (right?), what with the new game update and all, I will just wait for the fresh new code.

Whoa whoa whoa. SOMEBODY needs to rewrite that code.

Since it's your code and project, I figured that somebody would be you. :) But one of your contributors (toxxicfuse, maybe?) will be equally fine, of course; as long as it's done. Seriously. Can't downgrade the compiler, so kinda stuck there.

I can look into it when I got time :) Unless somebody else does it before me :)