Skip to content

Commit c0e3f53

Browse files
committed
fix typo and two small bugs claude found
1 parent abf5b67 commit c0e3f53

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

code/missioneditor/sexp_tree_model.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ SexpTreeEditorInterface::SexpTreeEditorInterface(const flagset<TreeFlags>& flags
147147
SexpTreeEditorInterface::~SexpTreeEditorInterface() = default;
148148

149149
// Returns true if mission-specific (non-builtin) messages exist.
150-
bool SexpTreeEditorInterface::hasDefaultMessageParamter()
150+
bool SexpTreeEditorInterface::hasDefaultMessageParameter()
151151
{
152152
return Num_messages > Num_builtin_messages;
153153
}
@@ -397,6 +397,7 @@ void SexpTreeModel::free_node2(int node)
397397
if (modified)
398398
*modified = 1;
399399
tree_nodes[node].type = SEXPT_UNUSED;
400+
tree_nodes[node].handle = nullptr;
400401
total_nodes--;
401402

402403
// Remove any annotation referencing this node so that if allocate_node()
@@ -934,7 +935,7 @@ int SexpTreeModel::query_false(int node) const
934935
// Look for the valid operator that is the closest match for 'str' and return the operator
935936
// number of it. What operators are valid is determined by 'node', and an operator is valid
936937
// if it is allowed to fit at position 'node'
937-
const SCP_string& SexpTreeModel::match_closest_operator(const SCP_string& str, int node) const
938+
SCP_string SexpTreeModel::match_closest_operator(const SCP_string& str, int node) const
938939
{
939940
int z, op, arg_num, opf;
940941

code/missioneditor/sexp_tree_model.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class SexpTreeEditorInterface {
170170
virtual ~SexpTreeEditorInterface();
171171

172172
// Returns true if there are mission-specific (non-builtin) messages available
173-
virtual bool hasDefaultMessageParamter();
173+
virtual bool hasDefaultMessageParameter();
174174
// Returns the list of mission-specific message names
175175
virtual SCP_vector<SCP_string> getMessages();
176176

@@ -510,7 +510,7 @@ class SexpTreeModel {
510510
// Return TRUE if the root operator is OP_FALSE
511511
int query_false(int node = -1) const;
512512
// Find the valid operator whose name most closely matches 'str' at position 'node'
513-
const SCP_string& match_closest_operator(const SCP_string& str, int node) const;
513+
SCP_string match_closest_operator(const SCP_string& str, int node) const;
514514
// Look up the help text string for the given sexp operator code
515515
static const char* help(int code);
516516
// Search all editable nodes for matching text; populates 'find' array, returns match count

code/missioneditor/sexp_tree_opf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,7 @@ int SexpTreeOPF::query_default_argument_available(int op, int i) const
27622762
}
27632763

27642764
case OPF_MESSAGE:
2765-
if (_model._interface && _model._interface->hasDefaultMessageParamter())
2765+
if (_model._interface && _model._interface->hasDefaultMessageParameter())
27662766
return 1;
27672767

27682768
return 0;

qtfred/src/ui/dialogs/MissionEventsDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ SCP_vector<SCP_string> MissionEventsDialog::getMessages()
227227
return out;
228228
}
229229

230-
bool MissionEventsDialog::hasDefaultMessageParamter()
230+
bool MissionEventsDialog::hasDefaultMessageParameter()
231231
{
232232
return !_model->getMessageList().empty();
233233
}

qtfred/src/ui/dialogs/MissionEventsDialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MissionEventsDialog: public QDialog, public SexpTreeEditorInterface {
3131
void reject() override;
3232

3333
SCP_vector<SCP_string> getMessages() override;
34-
bool hasDefaultMessageParamter() override;
34+
bool hasDefaultMessageParameter() override;
3535
int getRootReturnType() const override;
3636

3737
protected:

0 commit comments

Comments
 (0)