Author Topic: ROE compiling error  (Read 488 times)

0 Members and 1 Guest are viewing this topic.

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 757
  • Karma: +17/-69
    • View Profile
ROE compiling error
« on: April 02, 2016, 02:13:15 AM »
Ok I'm trying to compile the ROE source and I'm getting an error that has to do with conflicting event types. In Doom 3 it works fine but ROE needs the event to be a different type.

Here's the error:
Code: [Select]
3>AFEntity.cpp
3>.\d3xp\AFEntity.cpp(3539) : error C2440: 'initializing' : cannot convert from 'int' to 'idStr'
3>        Constructor for class 'idStr' is declared 'explicit'

It's referring to this section of code that has to do with harvesting souls with the Bloodstone:
Code: [Select]
if(requiredWeapons.Length() > 0) {
idStr playerWeap = thePlayer->GetCurrentWeapon();
if(playerWeap.Length() == 0 || requiredWeapons.Find(playerWeap, false) == -1) {
okToGive = false;
}
}

It needs the GetCurrentWeapon event to be an idStr type but I have it set up like this in Player.h for many different reasons:
Code: [Select]
int GetCurrentWeapon( void ) { return currentWeapon; };

Here's what it was originally set up as in the ROE source:
Code: [Select]
idStr GetCurrentWeapon();

Any ideas how to work around this? Commenting this section of code in AFEntity.cpp allows a full compile but in game crashes will occur if a harvet body is nearby and your not using the Bloodstone. You get an error that says function "Charge" is not in the script of whatever weapon you're currently using that's not the Bloodstone.
« Last Edit: April 02, 2016, 02:14:55 AM by VGames »
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

Phrozo

  • Mr. Phrozo
  • Jr. Member
  • **
  • Posts: 89
  • Karma: +15/-1
  • :3
    • View Profile
    • Mod Page
Re: ROE compiling error
« Reply #1 on: April 02, 2016, 03:31:02 AM »
Why did you change the return type from idStr to int? You either are going to have to revert back to idStr or refactor all code that calls GetCurrentWeapon()

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 757
  • Karma: +17/-69
    • View Profile
Re: ROE compiling error
« Reply #2 on: April 02, 2016, 11:55:18 AM »
Sikkmod did this for version 1.2. Since Sikkpin never made a version 1.2 for ROE he never addressed this issue. But I fixed it. I changed the bit of code in AFEntity.cpp to this:

Code: [Select]
if(requiredWeapons.Length() > 0) {
int playerWeap = thePlayer->GetCurrentWeapon();
if(playerWeap != 12) {
okToGive = false;
}
}

Worked like a charm. I had the same bad thoughts you had running through my head but then I figured out a much simpler method. Hope this helps somebody.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500