4.0 compile fix.

This commit is contained in:
Relintai 2020-06-20 22:36:31 +02:00
parent c22698baa8
commit dd2876d2e2
4 changed files with 30 additions and 4 deletions

View File

@ -22,6 +22,8 @@ SOFTWARE.
#include "loot_data_base.h"
#include "../../defines.h"
int LootDataBase::get_loot_db_size() const {
return _loot_dbs.size();
}
@ -140,7 +142,6 @@ bool LootDataBase::_set(const StringName &p_name, const Variant &p_value) {
String name = p_name;
if (name.begins_with("loot_dbs/")) {
int index = name.get_slicec('/', 1).to_int();
String what = name.get_slicec('/', 2);
@ -165,7 +166,6 @@ bool LootDataBase::_set(const StringName &p_name, const Variant &p_value) {
return false;
} else if (name.begins_with("items/")) {
int index = name.get_slicec('/', 1).to_int();
String what = name.get_slicec('/', 2);
@ -197,7 +197,6 @@ bool LootDataBase::_get(const StringName &p_name, Variant &r_ret) const {
String name = p_name;
if (name.begins_with("loot_dbs/")) {
int index = name.get_slicec('/', 1).to_int();
String what = name.get_slicec('/', 2);
@ -219,7 +218,6 @@ bool LootDataBase::_get(const StringName &p_name, Variant &r_ret) const {
return false;
} else if (name.begins_with("items/")) {
int index = name.get_slicec('/', 1).to_int();
String what = name.get_slicec('/', 2);

View File

@ -136,7 +136,11 @@ Vector<Variant> SpeciesModelData::get_customizable_slot_entries(const int slot_i
ERR_FAIL_INDEX_V(slot_index, _customizable_slots.size(), r);
for (int i = 0; i < _customizable_slots[slot_index].size(); i++) {
#if GODOT4
r.push_back(_customizable_slots[slot_index][i]);
#else
r.push_back(_customizable_slots[slot_index][i].get_ref_ptr());
#endif
}
return r;
}

View File

@ -33,8 +33,12 @@
#define SpatialEditorPlugin Node3DEditorPlugin
#define SpatialEditorViewport Node3DEditorViewport
#define PoolStringArray PackedStringArray
#define REAL FLOAT
#define POOL_STRING_ARRAY PACKED_STRING_ARRAY
#define POOL_INT_ARRAY PACKED_INT32_ARRAY
#define Spatial Node3D
typedef class RenderingServer VisualServer;

View File

@ -1691,10 +1691,16 @@ PoolIntArray Entity::states_gets() const {
PoolIntArray arr;
arr.resize(EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX);
#if !GODOT4
PoolIntArray::Write w = arr.write();
#endif
for (int i = 0; i < EntityEnums::ENTITY_STATE_TYPE_INDEX_MAX; ++i) {
#if !GODOT4
w[i] = _s_states[i];
#else
arr.write[i] = _s_states[i];
#endif
}
return arr;
@ -4789,10 +4795,17 @@ void Entity::class_talent_cclear() {
PoolIntArray Entity::sclass_talents_get() {
PoolIntArray arr;
arr.resize(_s_class_talents.size());
#if !GODOT4
PoolIntArray::Write w = arr.write();
#endif
for (int i = 0; i < _s_class_talents.size(); ++i) {
#if !GODOT4
w[i] = _s_class_talents[i];
#else
arr.write[i] = _s_class_talents[i];
#endif
}
return arr;
@ -5029,10 +5042,17 @@ void Entity::character_talent_cclear() {
PoolIntArray Entity::scharacter_talents_get() {
PoolIntArray arr;
arr.resize(_s_character_talents.size());
#if !GODOT4
PoolIntArray::Write w = arr.write();
#endif
for (int i = 0; i < _s_character_talents.size(); ++i) {
#if !GODOT4
w[i] = _s_character_talents[i];
#else
arr.write[i] = _s_character_talents[i];
#endif
}
return arr;