diff --git a/lib/Lacuna/DB/Result/Laws.pm b/lib/Lacuna/DB/Result/Laws.pm index 4be1a2ea..328bcda1 100644 --- a/lib/Lacuna/DB/Result/Laws.pm +++ b/lib/Lacuna/DB/Result/Laws.pm @@ -19,7 +19,7 @@ __PACKAGE__->add_columns( ); __PACKAGE__->typecast_map(type => { - EnactWrit => 'Lacuna::DB::Result::Laws::Writ', + Writ => 'Lacuna::DB::Result::Laws::Writ', }); __PACKAGE__->belongs_to('station', 'Lacuna::DB::Result::Map::Body', 'station_id'); diff --git a/lib/Lacuna/DB/Result/Propositions/EnactWrit.pm b/lib/Lacuna/DB/Result/Propositions/EnactWrit.pm index 837464c0..3b7cedf9 100644 --- a/lib/Lacuna/DB/Result/Propositions/EnactWrit.pm +++ b/lib/Lacuna/DB/Result/Propositions/EnactWrit.pm @@ -11,6 +11,7 @@ before pass => sub { name => $self->name, description => $self->description, type => 'Writ', + station_id => $self->station_id, })->insert; }; diff --git a/lib/Lacuna/RPC/Building/Parliament.pm b/lib/Lacuna/RPC/Building/Parliament.pm index 54360714..f390428c 100644 --- a/lib/Lacuna/RPC/Building/Parliament.pm +++ b/lib/Lacuna/RPC/Building/Parliament.pm @@ -115,7 +115,7 @@ sub propose_writ { confess [1015, 'Sitters cannot vote in parliament.']; } my $building = $self->get_building($empire, $building_id); - unless ($building->level >= 30) { + unless ($building->level >= 4) { confess [1013, 'Parliament must be level 4 to propose a writ.',4]; } Lacuna::Verify->new(content=>\$title, throws=>[1005,'Title cannot be empty.',$title])->not_empty; diff --git a/t/Parliament.t b/t/Parliament.t index fb30b357..a3044312 100644 --- a/t/Parliament.t +++ b/t/Parliament.t @@ -52,7 +52,7 @@ is($result->{result}{proposition}{my_vote}, 1, 'got my vote'); $result = $tester->post('parliament', 'propose_writ', [$session_id, $par->id, 'Do the big thing.', 'Make it go.']); is($result->{result}{proposition}{name}, 'Do the big thing.', 'writ proposed'); -$result = $tester->post('parliament', 'cast_vote', [$session_id, $par->id, $result->{result}{propositions}[0]{id}, 1]); +$result = $tester->post('parliament', 'cast_vote', [$session_id, $par->id, $result->{result}{proposition}{id}, 1]); $result = $tester->post('parliament', 'view_laws', [$session_id, $station->id]); is($result->{result}{laws}[0]{name}, 'Do the big thing.', 'writ enacted'); diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 9ea022ad..0ab978ea 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -2,6 +2,7 @@ - Rule: SAWs now cost less in upkeep. - API: Added proposing enacting writs at Parliament level 4. - API: Added proposing firing the station's BFG at Parliament level 30. + - API: Anyone can now view the laws passed by a space station, by simply calling view_laws() on the parliament. - API: The Mercenaries Guild API has been corrected. - API: The view_ships_orbiting() method of the SpacePort now correctly shows the foreign ships orbiting your planet as opposed to your ships that are orbiting foreign bodies. - Fix: Space station propositions weren't all working properly when passed/failed.