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

move members of player:: to Character:: #35148

Merged
merged 2 commits into from
Oct 31, 2019

Conversation

KorGgenT
Copy link
Member

@KorGgenT KorGgenT commented Oct 29, 2019

Summary

SUMMARY: Infrastructure "move a large number of members from player to character"

Purpose of change

part of #34721

Describe the solution

list of members moved:

update_bodytemp()
temp_equalizer()
blood_loss()
in_climate_control()
get_wind_resistance()
get_armor_fire()
is_wielding()
use_amount()
use_charges_if_avail()
use_charges()
has_fire()
use_fire()
metabolic_rate()
warmth()
bonus_item_warmth()
can_use_floor_warmth()
floor_bedding_warmth()
floor_item_warmth()
bodytemp_modifier_traits_floor()
bodytemp_modifier_traits()
temp_corrected_by_climate_control()
in_sleep_state()
global_square_location()
global_omt_location()
std::array<int, num_bp> temp_cur, frostbite_timer, temp_conv, body_wetness, drench_capacity
time_point next_climate_control_check
bool last_climate_control_ret

Testing

Additional context

@KorGgenT KorGgenT added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Oct 29, 2019
@ifreund ifreund marked this pull request as ready for review October 30, 2019 00:28
@ifreund
Copy link
Contributor

ifreund commented Oct 30, 2019

Fixed the merge conflicts, should be good to go.

@kevingranade
Copy link
Member

g++ -DGIT_VERSION -DBACKTRACE -DLOCALIZE -ffast-math -Og -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -g -fsigned-char -std=c++14 -MMD -MP -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -I../src -Wno-unused-variable -Wno-sign-compare -Wno-unknown-pragmas -Wno-parentheses -MMD -MP -Wall -Wextra -c npc_talk_test.cpp -o obj/npc_talk_test.o
npc_talk_test.cpp: In lambda function:
npc_talk_test.cpp:564:37: error: no match for call to ‘(const item_category_id {aka const string_id<item_category>}) ()’
return it.get_category().id() == "books" || it.get_category().id() == "food" ||
^
npc_talk_test.cpp:564:74: error: no match for call to ‘(const item_category_id {aka const string_id<item_category>}) ()’
return it.get_category().id() == "books" || it.get_category().id() == "food" ||
^
npc_talk_test.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____42()’:
npc_talk_test.cpp:566:7: error: no matching function for call to ‘avatar::remove_items_with(____C_A_T_C_H____T_E_S_T____42()::<lambda(const item&)>)’
} );
^
In file included from ../src/map_selector.h:8:0,
from ../src/item_location.h:8,
from ../src/item.h:24,
from ../src/inventory.h:18,
from ../src/character.h:24,
from ../src/player.h:21,
from ../src/avatar.h:12,
from npc_talk_test.cpp:6:
../src/visitable.h:110:25: note: candidate: std::__cxx11::list visitable::remove_items_with(const std::function<bool(const item&)>&, int) [with T = Character]
std::list remove_items_with( const std::function<bool( const item & )> &filter,
^~~~~~~~~~~~~~~~~
../src/visitable.h:110:25: note: no known conversion for argument 1 from ‘____C_A_T_C_H____T_E_S_T____42()::<lambda(const item&)>’ to ‘const std::function<bool(const item&)>&’
make[1]: *** [obj/npc_talk_test.o] Error 1
Makefile:49: recipe for target 'obj/npc_talk_test.o' failed
make: *** [tests] Error 2

@AMurkin
Copy link
Contributor

AMurkin commented Oct 30, 2019

npc_talk_test.cpp:564:37: error: no match for call to ‘(const item_category_id {aka const string_id<item_category>}) ()’

I think that's from the #35147. Two branches together?

Moved:
is_wielding()
use_amount()
use_charges()
use_charges_if_avail()
use_fire()
This function is massive and dragged a whole bunch of stuff along with it.
@ifreund
Copy link
Contributor

ifreund commented Oct 30, 2019

Couldn't reproduce those build errors @kevingranade. Just force-pushed again to resolve a minor conflict.

@kevingranade kevingranade merged commit 0278ae1 into CleverRaven:master Oct 31, 2019
@ifreund ifreund deleted the player-to-character branch October 31, 2019 08:28
esotericist pushed a commit to esotericist/Cataclysm-DDA that referenced this pull request Oct 31, 2019
@ymber
Copy link
Member

ymber commented Oct 31, 2019

This introduced #35184.

esotericist added a commit that referenced this pull request Oct 31, 2019
ifreund added a commit to ifreund/Cataclysm-DDA that referenced this pull request Oct 31, 2019
esotericist pushed a commit that referenced this pull request Oct 31, 2019
* Revert "Revert "Merge pull request #35148 from ifreund/player-to-character" (#35185)"

This reverts commit 15bd2e1.

* Remove duplicated json fields in save

I overlooked removing these in the last commit which caused saves to
store without error despite the duplication but fail to load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants