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

Tidy up point handling in tutorial code #32662

Merged
merged 1 commit into from
Jul 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/tutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ bool tutorial_game::init()
g->u.name = _( "John Smith" );
g->u.prof = profession::generic();
// overmap terrain coordinates
const int lx = 50;
const int ly = 50;
const tripoint lp( 50, 50, 0 );
auto &starting_om = overmap_buffer.get( point_zero );
for( int i = 0; i < OMAPX; i++ ) {
for( int j = 0; j < OMAPY; j++ ) {
starting_om.ter( { i, j, -1 } ) = rock;
tripoint p( i, j, 0 );
starting_om.ter( p + tripoint_below ) = rock;
// Start with the overmap revealed
starting_om.seen( { i, j, 0 } ) = true;
starting_om.seen( p ) = true;
}
}
starting_om.ter( { lx, ly, 0 } ) = oter_id( "tutorial" );
starting_om.ter( { lx, ly, -1 } ) = oter_id( "tutorial" );
starting_om.ter( lp ) = oter_id( "tutorial" );
starting_om.ter( lp + tripoint_below ) = oter_id( "tutorial" );
starting_om.clear_mon_groups();

g->u.toggle_trait( trait_id( "QUICK" ) );
Expand All @@ -84,7 +84,7 @@ bool tutorial_game::init()
g->u.inv.add_item( lighter, true, false );
g->u.set_skill_level( skill_id( "gun" ), 5 );
g->u.set_skill_level( skill_id( "melee" ), 5 );
g->load_map( omt_to_sm_copy( tripoint( lx, ly, 0 ) ) );
g->load_map( omt_to_sm_copy( lp ) );
g->u.setx( 2 );
g->u.sety( 4 );

Expand Down