Skip to content

Commit

Permalink
only pass client to exec(). it contains the controller anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
Desour committed Dec 17, 2024
1 parent 7995006 commit c5eafd1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/script/sscsm_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SSCSMController::~SSCSMController()

SerializedSSCSMAnswer SSCSMController::handleRequest(Client *client, ISSCSMRequest *req)
{
return req->exec(this, client);
return req->exec(client);
}

void SSCSMController::runEvent(Client *client, std::unique_ptr<ISSCSMEvent> event)
Expand Down
2 changes: 1 addition & 1 deletion src/script/sscsm_irequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct ISSCSMRequest
{
virtual ~ISSCSMRequest() = default;

virtual SerializedSSCSMAnswer exec(SSCSMController *cntrl, Client *client) = 0;
virtual SerializedSSCSMAnswer exec(Client *client) = 0;
};

// FIXME: actually serialize, and replace this with a string
Expand Down
4 changes: 2 additions & 2 deletions src/script/sscsm_requests.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct SSCSMAnswerPollNextEvent : public ISSCSMAnswer

struct SSCSMRequestPollNextEvent : public ISSCSMRequest
{
SerializedSSCSMAnswer exec(SSCSMController *cntrl, Client *client) override
SerializedSSCSMAnswer exec(Client *client) override
{
FATAL_ERROR("SSCSMRequestPollNextEvent needs to be handled by SSCSMControler::runEvent()");
}
Expand All @@ -41,7 +41,7 @@ struct SSCSMRequestGetNode : public ISSCSMRequest

SSCSMRequestGetNode(v3s16 pos_) : pos(pos_) {}

SerializedSSCSMAnswer exec(SSCSMController *cntrl, Client *client) override
SerializedSSCSMAnswer exec(Client *client) override
{
MapNode node = client->getEnv().getMap().getNode(pos);

Expand Down

0 comments on commit c5eafd1

Please sign in to comment.